diff options
author | Stephen Beaver <sbeaver@netgate.com> | 2015-10-27 21:39:10 -0400 |
---|---|---|
committer | Stephen Beaver <sbeaver@netgate.com> | 2015-10-27 21:39:10 -0400 |
commit | f9e5e4e2d12c606ce1b2b014dddd5750bd936cca (patch) | |
tree | 5bdcb794980c9f57ce055238ba807910f0576351 /src | |
parent | c04119301a582f0cb88686d2685e5d585d510562 (diff) | |
download | pfsense-f9e5e4e2d12c606ce1b2b014dddd5750bd936cca.zip pfsense-f9e5e4e2d12c606ce1b2b014dddd5750bd936cca.tar.gz |
Converted the background color javascript to jQuery and used it to maintain correct table striping
Diffstat (limited to 'src')
-rw-r--r-- | src/usr/local/www/firewall_rules.php | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/usr/local/www/firewall_rules.php b/src/usr/local/www/firewall_rules.php index 38b0fb4..6d2e94e 100644 --- a/src/usr/local/www/firewall_rules.php +++ b/src/usr/local/www/firewall_rules.php @@ -698,19 +698,23 @@ function fr_toggle(id, prefix) { fr_bgcolor(id, prefix); } +// Change background color based on state of checkbox +// On resetting background, reapply table striping function fr_bgcolor(id, prefix) { if (!prefix) prefix = 'fr'; - var row = document.getElementById(prefix + id); - var checkbox = document.getElementById(prefix + 'c' + id); - var cells = row.getElementsByTagName('td'); - var cellcnt = cells.length; + var row = $('#' + prefix + id); - for (i = 0; i < cellcnt-1; i++) { - cells[i].style.backgroundColor = checkbox.checked ? "#DDF4FF" : "#FFFFFF"; + if ($('#' + prefix + 'c' + id).prop('checked') ) { + row.css("background-color", "#DDF4FF"); + row.removeClass('active'); + } else { + row.css("background-color", "#FFFFFF"); + $("tr:odd").addClass('active'); } } + </script> <script> |