From 6822475674ffb03584a6d1ed35239010c33a7e60 Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Fri, 26 Feb 2021 01:12:48 +0100 Subject: [PATCH] exclude template inputs when moving to the visible section --- htdocs/lib/settings/OptionalSection.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/lib/settings/OptionalSection.js b/htdocs/lib/settings/OptionalSection.js index 4ba9b6d..6c4ce74 100644 --- a/htdocs/lib/settings/OptionalSection.js +++ b/htdocs/lib/settings/OptionalSection.js @@ -6,7 +6,10 @@ $.fn.optionalSection = function(){ $section.on('click', '.option-add-button', function(e){ var field = $select.val(); var group = $optionalInputs.find(".form-group[data-field='" + field + "']"); - group.find('input, select').prop('disabled', false); + group.find('input, select').filter(function(){ + // exclude template inputs + return !$(this).parents('.template').length; + }).prop('disabled', false); $section.find('hr').before(group); $select.find('option[value=\'' + field + '\']').remove();