summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSteve Beaver <sbeaver@netgate.com>2016-10-03 09:29:32 -0400
committerSteve Beaver <sbeaver@netgate.com>2016-10-03 09:32:09 -0400
commit25383c9adfa2abbf5dfcdc9b504f19b9c2b3bbc5 (patch)
tree0389cbee1be3de0649e5ef6ed7ae2f7dfe3ee404 /src
parent9b42c1ffb1369469af5c37963dadd264c22b7772 (diff)
downloadpfsense-25383c9adfa2abbf5dfcdc9b504f19b9c2b3bbc5.zip
pfsense-25383c9adfa2abbf5dfcdc9b504f19b9c2b3bbc5.tar.gz
Fixed #6835 by revising Javascript show/hide
(cherry picked from commit 850c3d8b9352e7467beca8502c24ca8d4fbbbd29)
Diffstat (limited to 'src')
-rw-r--r--src/usr/local/www/firewall_nat_out_edit.php16
-rw-r--r--src/usr/local/www/js/pfSenseHelpers.js10
2 files changed, 10 insertions, 16 deletions
diff --git a/src/usr/local/www/firewall_nat_out_edit.php b/src/usr/local/www/firewall_nat_out_edit.php
index 17dc578..62bd173 100644
--- a/src/usr/local/www/firewall_nat_out_edit.php
+++ b/src/usr/local/www/firewall_nat_out_edit.php
@@ -589,7 +589,7 @@ $section->addInput(new Form_IpAddress(
'targetip',
'Other subnet',
$pconfig['targetip']
-))->addMask('targetip_subnet', $pconfig['targetip_subnet'])->addClass('othersubnet')->setHelp(
+))->addMask('targetip_subnet', $pconfig['targetip_subnet'])->setHelp(
'Packets matching this rule will be mapped to the IP address given here.' . '<br />' .
'To apply this rule to a different IP address than the IP address of the interface chosen above, ' .
'select it here (' .
@@ -623,7 +623,7 @@ $section->addInput(new Form_Input(
'Source Hash Key',
'text',
$pconfig['source_hash_key']
-))->setHelp('The key that is fed to the hashing algorithm in hex format, preceeded by "0x", or any string. A non-hex string is hashed using md5 to a hexadecimal key. Defaults to a randomly generated value.')->setWidth(10)->addClass('othersubnet');
+))->setHelp('The key that is fed to the hashing algorithm in hex format, preceeded by "0x", or any string. A non-hex string is hashed using md5 to a hexadecimal key. Defaults to a randomly generated value.')->setWidth(10);
$group = new Form_Group('Port');
$group->addClass('natportgrp');
@@ -768,13 +768,15 @@ events.push(function() {
function poolopts_change() {
if ($('#target option:selected').text().trim().substring(0,4) == "Host") {
hideInput('poolopts', false);
- hideGroupClass('othersubnet', true);
+ hideInput('source_host_key', true);
+ hideIpAddress('targetip', true);
} else if ($('#target option:selected').text().trim().substring(0,6) == "Subnet") {
hideInput('poolopts', false);
- hideGroupClass('othersubnet', true);
+ hideInput('source_host_key', true);
+ hideIpAddress('targetip', true);
} else if ($('#target option:selected').text().trim().substring(0,5) == "Other") {
hideInput('poolopts', false);
- hideGroupClass('othersubnet', false);
+ hideIpAddress('targetip', false);
if ($('#poolopts option:selected').text().trim().substring(0,6) == "Source") {
hideInput('source_hash_key', false);
}else {
@@ -783,8 +785,8 @@ events.push(function() {
} else {
$('#poolopts').prop('selectedIndex',0);
hideInput('poolopts', true);
- hideGroupClass('othersubnet', true);
- hideInput('source_hash_key', true);
+ hideInput('source_host_key', true);
+ hideIpAddress('targetip', true);
$('#targetip').val('');
$('#targetip_subnet').val('0');
}
diff --git a/src/usr/local/www/js/pfSenseHelpers.js b/src/usr/local/www/js/pfSenseHelpers.js
index 4b98392..83cfd22 100644
--- a/src/usr/local/www/js/pfSenseHelpers.js
+++ b/src/usr/local/www/js/pfSenseHelpers.js
@@ -90,14 +90,6 @@ function hideClass(s_class, hide) {
$('.' + s_class).show();
}
-// Hides all elements of the specified class assigned to a group. This will usually be a group
-function hideGroupClass(s_class, hide) {
- if (hide)
- $('.' + s_class).parent().parent().parent().hide();
- else
- $('.' + s_class).parent().parent().parent().show();
-}
-
function hideSelect(id, hide) {
if (hide)
$('#' + id).parent('div').parent('div').addClass('hidden');
@@ -112,7 +104,7 @@ function hideMultiCheckbox(id, hide) {
$("[name=" + id + "]").parent().removeClass('hidden');
}
-// Hides the <div> in which the specified IP address element lives so that the input, its label and help text are hidden
+// Hides the <div> in which the specified IP address element lives so that the input, any mask selector, its label and help text are hidden
function hideIpAddress(id, hide) {
if (hide)
$('#' + id).parent().parent().parent('div').addClass('hidden');
OpenPOWER on IntegriCloud