From fdc8cc34fa615b2bb0262fc4130d960af373d784 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 14 Nov 2023 17:40:33 +0100 Subject: [PATCH] firewall: move click() from tr to button #6991 Plus minor cleanups. --- src/www/firewall_rules.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/www/firewall_rules.php b/src/www/firewall_rules.php index a2204c5d2..a54de2f62 100644 --- a/src/www/firewall_rules.php +++ b/src/www/firewall_rules.php @@ -441,7 +441,7 @@ $( document ).ready(function() { $("#iform").submit(); }); - // link move buttons + // link apply button $("#btn_apply").click(function(event){ event.preventDefault(); $("#action").val("apply"); @@ -580,21 +580,20 @@ $( document ).ready(function() { $("#"+tmp+"-rule-count").text($("tr."+tmp+"-rule").length); } if ($(this).hasClass('is_collapsed')) { - $("."+tmp+"-rule").hide(); + $("tr."+tmp+"-rule").hide(); } }); }); - - $(".expand_type").each(function(){ - $("#expand-"+$(this).data('type')+"-rules").click(function(event){ + $("#expand-"+$(this).data('type')).click(function(event){ event.preventDefault(); - $(this).toggleClass('is_collapsed'); + $(this).parent().parent().toggleClass('is_collapsed'); // trigger category change as this will show/hide all "rule" rows (and fires an event on .opnsense-rules ) $("#fw_category").change(); }); }); + // tooltip interface list $(".interface_tooltip").tooltip({ html: true,