summaryrefslogtreecommitdiffstats
path: root/src/usr/local/www/js
diff options
context:
space:
mode:
authorStephen Beaver <sbeaver@netgate.com>2016-08-15 14:47:05 -0400
committerStephen Beaver <sbeaver@netgate.com>2016-08-15 14:54:12 -0400
commiteb53e87330d1928ad7c3fe1425cd2b29590d171b (patch)
treea0eff0024f2ca609e87b4633137d7c6250bb7206 /src/usr/local/www/js
parent0e0633070204e55935539c360e38011b4dcdb7a0 (diff)
downloadpfsense-eb53e87330d1928ad7c3fe1425cd2b29590d171b.zip
pfsense-eb53e87330d1928ad7c3fe1425cd2b29590d171b.tar.gz
Fixed #6716
(cherry picked from commit 4d4782fcd7213b5f279cb372853f5fedb07f6178)
Diffstat (limited to 'src/usr/local/www/js')
-rw-r--r--src/usr/local/www/js/pfSenseHelpers.js13
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();
OpenPOWER on IntegriCloud