summaryrefslogtreecommitdiffstats
path: root/src/usr/local/www/firewall_rules_edit.php
diff options
context:
space:
mode:
authorSteve Beaver <sbeaver@netgate.com>2017-08-11 15:28:44 -0400
committerSteve Beaver <sbeaver@netgate.com>2017-08-11 15:30:45 -0400
commit8150bd51a7179da5d9aa1af49c44983b075bb962 (patch)
tree5a5361a966180b22e28ea435fb52ecb1c5c609f4 /src/usr/local/www/firewall_rules_edit.php
parenta0678b0bd89ef33a5ec272fd2a6544dc898938b8 (diff)
downloadpfsense-8150bd51a7179da5d9aa1af49c44983b075bb962.zip
pfsense-8150bd51a7179da5d9aa1af49c44983b075bb962.tar.gz
Fixed #7625
By: Separating the source and destination onChange functions Preventing the mask selector from being automatically updated if it is disabled Simplifying the auto mask JavaScript
Diffstat (limited to 'src/usr/local/www/firewall_rules_edit.php')
-rw-r--r--src/usr/local/www/firewall_rules_edit.php17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/usr/local/www/firewall_rules_edit.php b/src/usr/local/www/firewall_rules_edit.php
index 3a462c3..b30e3f3 100644
--- a/src/usr/local/www/firewall_rules_edit.php
+++ b/src/usr/local/www/firewall_rules_edit.php
@@ -329,7 +329,7 @@ if ($_POST['save']) {
if (!(is_string($_POST['type']) && in_array($_POST['type'], $valid))) {
$input_errors[] = gettext("A valid rule type is not selected.");
unset($_POST['type']);
- }
+ }
if (isset($_POST['tracker']) && !is_numericint($_POST['tracker'])) {
unset($_POST['tracker']); // silently unset hidden input if invalid
@@ -1865,10 +1865,16 @@ events.push(function() {
} else {
text = "<?=gettext('Display Advanced');?>";
}
+
$('#btnsrctoggle').html('<i class="fa fa-cog"></i> ' + text);
}
function typesel_change() {
+ src_typesel_change();
+ dst_typesel_change();
+ }
+
+ function src_typesel_change() {
if (editenabled) {
switch ($('#srctype').find(":selected").index()) {
case 1: // single
@@ -1887,6 +1893,11 @@ events.push(function() {
disableInput('srcmask', true);
break;
}
+ }
+ }
+
+ function dst_typesel_change() {
+ if (editenabled) {
switch ($('#dsttype').find(":selected").index()) {
case 1: // single
disableInput('dst', false);
@@ -2037,11 +2048,11 @@ events.push(function() {
});
$('#srctype').on('change', function() {
- typesel_change();
+ src_typesel_change();
});
$('#dsttype').on('change', function() {
- typesel_change();
+ dst_typesel_change();
});
$('#ipprotocol').on('change', function() {
OpenPOWER on IntegriCloud