diff options
author | Stephen Beaver <sbeaver@netgate.com> | 2015-09-08 09:36:36 -0400 |
---|---|---|
committer | Stephen Beaver <sbeaver@netgate.com> | 2015-09-08 09:38:05 -0400 |
commit | cddc70a20177dd4d2d622f6dd8e9e08f181774c8 (patch) | |
tree | 3584ff54c82897d7c6a9d90a60eb8a63da104a27 /src/usr/local/www/jquery | |
parent | 1167a8c539d72f70c564d02763af0d678330f5bf (diff) | |
download | pfsense-cddc70a20177dd4d2d622f6dd8e9e08f181774c8.zip pfsense-cddc70a20177dd4d2d622f6dd8e9e08f181774c8.tar.gz |
Fixed #5102
javascript revised to accommodate VPN masks
Diffstat (limited to 'src/usr/local/www/jquery')
-rw-r--r-- | src/usr/local/www/jquery/pfSense.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/usr/local/www/jquery/pfSense.js b/src/usr/local/www/jquery/pfSense.js index ffd56dc..d1c9f65 100644 --- a/src/usr/local/www/jquery/pfSense.js +++ b/src/usr/local/www/jquery/pfSense.js @@ -95,9 +95,10 @@ $(function() { }); })(); + // Automatically change IpAddress mask selectors to 128/32 options for IPv6/IPvd addresses $('span.pfIpMask + select').each(function (idx, select){ var input = $(select).prevAll('input[type=text]'); - + input.on('change', function(e){ var isV6 = (input.val().indexOf(':') != -1), min = 0, max = 128; if (!isV6) @@ -106,11 +107,11 @@ $(function() { if (input.val() == "") return; - while (select.options.length > max) + // Eat all of the options with a value greater than max. We don't want them to be available + while (select.options[0].value > max) select.remove(0); - - if (select.options.length < max) - { + + if (select.options.length < max) { for (var i=select.options.length; i<=max; i++) select.options.add(new Option(i, i), 0); } |