exclude template inputs when moving to the visible section

This commit is contained in:
Jakob Ketterl 2021-02-26 01:12:48 +01:00
parent 412e0a51c7
commit 6822475674

View File

@ -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();