Firewall: Hide rule actions when using NAT.
authorStefan Schantl <stefan.schantl@ipfire.org>
Tue, 14 Jan 2014 21:09:13 +0000 (22:09 +0100)
committerStefan Schantl <stefan.schantl@ipfire.org>
Tue, 14 Jan 2014 21:09:13 +0000 (22:09 +0100)
There is no need to choose a rule action when creating a NAT rule, so this
section can be hidden when "Use NAT" has been checked.

html/cgi-bin/firewall.cgi

index 5196670..2a9415a 100644 (file)
@@ -136,14 +136,17 @@ print<<END;
                \$("#protocol").change(update_protocol);
                update_protocol();
 
-               // When nat not used, hide it
-               if (! \$("#USE_NAT").attr("checked")) {
+               // Show/Hide elements when NAT checkbox is checked.
+               if (\$("#USE_NAT").attr("checked")) {
+                       \$("#actions").hide();
+               } else {
                        \$(".NAT").hide();
                }
 
                // Show NAT area when "use nat" checkbox is clicked
                \$("#USE_NAT").change(function() {
                        \$(".NAT").toggle();
+                       \$("#actions").toggle();
                });
 
                // Time constraints