diff --git a/domain-server/resources/web/settings/js/settings.js b/domain-server/resources/web/settings/js/settings.js index 3ddf9722fb..43a3c89534 100644 --- a/domain-server/resources/web/settings/js/settings.js +++ b/domain-server/resources/web/settings/js/settings.js @@ -232,16 +232,17 @@ $(document).ready(function(){ badgeSidebarForDifferences($(this)); }); - // Bootstrap switch in table $('#' + Settings.FORM_ID).on('switchChange.bootstrapSwitch', 'input.table-checkbox', function () { - // Bootstrap switches in table: set the changed data attribute for all rows. + // Bootstrap switches in table: set the changed data attribute for all rows in table. var row = $(this).closest('tr'); - row.find('td.' + Settings.DATA_COL_CLASS + ' input').attr('data-changed', true); - updateDataChangedForSiblingRows(row, true); + if (row.hasClass("value-row")) { // Don't set attribute on input row switches prior to it being added to table. + row.find('td.' + Settings.DATA_COL_CLASS + ' input').attr('data-changed', true); + updateDataChangedForSiblingRows(row, true); + badgeSidebarForDifferences($(this)); + } }); - $('.advanced-toggle').click(function(){ Settings.showAdvanced = !Settings.showAdvanced var advancedSelector = $('.' + Settings.ADVANCED_CLASS) @@ -850,6 +851,7 @@ function reloadSettings(callback) { // setup any bootstrap switches $('.toggle-checkbox').bootstrapSwitch(); + $('.table-checkbox').bootstrapSwitch(); // add tooltip to locked settings $('label.locked').tooltip({ @@ -982,7 +984,7 @@ function makeTable(setting, keypath, setting_value, isLocked) { if (isArray && col.type === "checkbox" && col.editable) { html += "