diff options
author | Stephen Beaver <sbeaver@netgate.com> | 2015-09-17 14:27:49 -0400 |
---|---|---|
committer | Stephen Beaver <sbeaver@netgate.com> | 2015-09-17 14:27:49 -0400 |
commit | b22368535d6c9781b30b33a23b4d1c4b4d4c9360 (patch) | |
tree | 7c48b8ec8303b224ef11285325185555f8d065d8 /src/usr/local/www/firewall_rules_edit.php | |
parent | 860caa2fe545036685c1225be82d538fb40b1341 (diff) | |
download | pfsense-b22368535d6c9781b30b33a23b4d1c4b4d4c9360.zip pfsense-b22368535d6c9781b30b33a23b4d1c4b4d4c9360.tar.gz |
Fixed #5099
Javascript logic changged for source port display
"Advanced" button now has toggle acton and its state survives a protocol change.
Diffstat (limited to 'src/usr/local/www/firewall_rules_edit.php')
-rw-r--r-- | src/usr/local/www/firewall_rules_edit.php | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/usr/local/www/firewall_rules_edit.php b/src/usr/local/www/firewall_rules_edit.php index 66b0397..c636c96 100644 --- a/src/usr/local/www/firewall_rules_edit.php +++ b/src/usr/local/www/firewall_rules_edit.php @@ -1708,6 +1708,7 @@ events.push(function(){ var portsenabled = 1; var editenabled = 1; var optionsvisible = 0; + var srcportsvisible = 0; function ext_change() { if (($('#srcbeginport').find(":selected").index() == 0) && portsenabled && editenabled) { @@ -1762,10 +1763,7 @@ events.push(function(){ } function show_source_port_range() { - if (portsenabled) { - hideInput('btnsrcadv', true); - hideClass('srcprtr', false); - } + hideClass('srcprtr', !srcportsvisible); } function typesel_change() { @@ -1850,11 +1848,14 @@ events.push(function(){ } if ($('#proto').find(":selected").index() <= 2) { - hideClass('dstprtr', false); - hideClass('srcprtr', false); + hideClass('dstprtr', !srcportsvisible); + hideClass('srcprtr', !srcportsvisible); + $("#btnsrcadv").prop('value', srcportsvisible ? 'Hide advanced':'Show advanced'); } else { hideClass('srcprtr', true); hideClass('dstprtr', true); + srcportsvisible = 0; + $("#btnsrcadv").prop('value', srcportsvisible ? 'Hide advanced':'Show advanced'); } } @@ -1891,8 +1892,9 @@ events.push(function(){ }); $('#btnsrcadv').click(function() { - hideClass('srcportrange', false); - hideInput('btnsrcadv', true); + srcportsvisible = !srcportsvisible; + show_source_port_range(); + $("#btnsrcadv").prop('value', srcportsvisible ? 'Hide advanced':'Show advanced'); }); $('#srcendport').on('change', function() { |