diff options
author | Stephen Beaver <sbeaver@netgate.com> | 2015-12-07 15:19:48 -0500 |
---|---|---|
committer | Stephen Beaver <sbeaver@netgate.com> | 2015-12-07 15:21:28 -0500 |
commit | c24178cda3b6e9c0807c18421e2f42053d6a79c7 (patch) | |
tree | e5eaf6a542f146d96e3012477dfaee40f8131671 /src/usr | |
parent | fff8311825126bafdf3b98bfabd64d09752ff726 (diff) | |
download | pfsense-c24178cda3b6e9c0807c18421e2f42053d6a79c7.zip pfsense-c24178cda3b6e9c0807c18421e2f42053d6a79c7.tar.gz |
Fixed #5593
The jQuery required to fix this is tricky, but I believe this fixes the issue by re-adding the autoselect data to newly cloned groups.
Diffstat (limited to 'src/usr')
-rwxr-xr-x | src/usr/local/www/firewall_aliases_edit.php | 12 | ||||
-rw-r--r-- | src/usr/local/www/jquery/pfSenseHelpers.js | 12 |
2 files changed, 16 insertions, 8 deletions
diff --git a/src/usr/local/www/firewall_aliases_edit.php b/src/usr/local/www/firewall_aliases_edit.php index 3f2563b..4656541 100755 --- a/src/usr/local/www/firewall_aliases_edit.php +++ b/src/usr/local/www/firewall_aliases_edit.php @@ -739,6 +739,8 @@ print $form; <script type="text/javascript"> //<![CDATA[ +addressarray = <?= json_encode(array_exclude($pconfig['name'], get_alias_list($pconfig['type']))) ?>; + events.push(function(){ var disable_subnets; @@ -812,10 +814,12 @@ events.push(function(){ checkLastRow(); // Autocomplete - var addressarray = <?= json_encode(array_exclude($pconfig['name'], get_alias_list($pconfig['type']))) ?>; - - $('[id^=address]').autocomplete({ - source: addressarray + $('[id^=address]').each(function() { + if(this.id.substring(0, 8) != "address_") { + $(this).autocomplete({ + source: addressarray + }); + } }); // on click . . diff --git a/src/usr/local/www/jquery/pfSenseHelpers.js b/src/usr/local/www/jquery/pfSenseHelpers.js index aac6def..e9f4c55 100644 --- a/src/usr/local/www/jquery/pfSenseHelpers.js +++ b/src/usr/local/www/jquery/pfSenseHelpers.js @@ -288,8 +288,7 @@ function add_row() { var lastRepeatableGroup = $('.repeatable:last'); // Clone it - var newGroup = lastRepeatableGroup.clone(true); - + var newGroup = lastRepeatableGroup.clone(); // Increment the suffix number for each input element in the new group $(newGroup).find('input').each(function() { $(this).prop("id", bumpStringInt(this.id)); @@ -332,8 +331,13 @@ function add_row() { checkLastRow(); - $('[id^=address]').autocomplete({ - source: addressarray + // Autocomplete + $('[id^=address]').each(function() { + if(this.id.substring(0, 8) != "address_") { + $(this).autocomplete({ + source: addressarray + }); + } }); } |