From c536dc353f6589c84ed3200c62ec96db440e1eed Mon Sep 17 00:00:00 2001 From: Sebastian Castro <sebastian.castro@protonmail.com> Date: Fri, 7 May 2021 13:49:50 +0200 Subject: [PATCH] form-builder: conditionally display search weight --- .../core_custom/custom-fields/form-builder.html.twig | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/templates/admin/core_custom/custom-fields/form-builder.html.twig b/templates/admin/core_custom/custom-fields/form-builder.html.twig index c28a1ea31..346269590 100755 --- a/templates/admin/core_custom/custom-fields/form-builder.html.twig +++ b/templates/admin/core_custom/custom-fields/form-builder.html.twig @@ -236,6 +236,14 @@ textarea.title = this.title return textarea }) + + $('.search-wrap:not(.initialized)').each(function() { + $(this).addClass('initialized') + var $weightWrapper = $(this).siblings('.searchWeight-wrap') + $(this).find('input').change(function() { + $weightWrapper.toggle($(this).is(':checked')) + }).trigger('change') + }) // $('.name-wrap input[name=name]').val('email'); // get all input names (used to check for uniqueness) var allNames = []; @@ -385,4 +393,8 @@ .form-wrap.form-builder .frmb .field-actions { z-index: 500000; } + + .searchWeight-wrap { + display: none; + } </style> \ No newline at end of file -- GitLab