diff options
Diffstat (limited to 'src/usr/local/www/js/pfSenseHelpers.js')
-rw-r--r-- | src/usr/local/www/js/pfSenseHelpers.js | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/usr/local/www/js/pfSenseHelpers.js b/src/usr/local/www/js/pfSenseHelpers.js index db5b40e..e5f3b43 100644 --- a/src/usr/local/www/js/pfSenseHelpers.js +++ b/src/usr/local/www/js/pfSenseHelpers.js @@ -221,17 +221,20 @@ function setMasks() { // Complicated function to move all help text associated with this input id to the same id // on the row above. That way if you delete the last row, you don't lose the help function moveHelpText(id) { - $('#' + id).parent('div').parent('div').find('input, select, checkbox').each(function() { // For each <span></span> + + $('#' + id).parent('div').parent('div').find('input, select, checkbox, button').each(function() { // For each <span></span> var fromId = this.id; var toId = decrStringInt(fromId); var helpSpan; - if (!$(this).hasClass('pfIpMask') && !$(this).hasClass('btn')) { + + if (!$(this).hasClass('pfIpMask') && !$(this).hasClass('btn') && ! fromId.startsWith("mask")) { if ($('#' + decrStringInt(fromId)).parent('div').hasClass('input-group')) { helpSpan = $('#' + fromId).parent('div').parent('div').find('span:last').clone(); } else { helpSpan = $('#' + fromId).parent('div').find('span:last').clone(); } + if ($(helpSpan).hasClass('help-block')) { if ($('#' + decrStringInt(fromId)).parent('div').hasClass('input-group')) { $('#' + decrStringInt(fromId)).parent('div').after(helpSpan); @@ -280,6 +283,11 @@ function renumber() { $(this).prop("name", this.name.replace(/\d+$/, "") + idx); }); + $(this).find('button').each(function() { + $(this).prop("id", this.id.replace(/\d+$/, "") + idx); + $(this).prop("name", this.name.replace(/\d+$/, "") + idx); + }); + // $(this).find('label').attr('for', $(this).find('label').attr('for').replace(/\d+$/, "") + idx); idx++; @@ -295,6 +303,7 @@ function delete_row(rowDelBtn) { } $('#' + rowDelBtn).parent('div').parent('div').remove(); + renumber(); checkLastRow(); |