Merge pull request #6295 from jjm2473/patch-1
authorPaul Donald <newtwen@gmail.com>
Mon, 4 Dec 2023 02:44:10 +0000 (03:44 +0100)
committerPaul Donald <newtwen@gmail.com>
Mon, 4 Dec 2023 22:40:37 +0000 (23:40 +0100)
luci-mod-status: fix iptables jump on argon theme
(cherry picked from commit 706668243b8617d5c5529ac76e54f84dc57203e3)

modules/luci-mod-status/htdocs/luci-static/resources/view/status/iptables.js

index 951c31218d858e1f81ac8137778788cd2655613d..743d95000cf11395e947deafe73a178b20e7fe23 100644 (file)
@@ -252,7 +252,11 @@ return view.extend({
                    elem = document.getElementById('rule_%s_%s'.format(table.toLowerCase(), chain));
 
                if (elem) {
-                       (document.documentElement || document.body.parentNode || document.body).scrollTop = elem.offsetTop - 40;
+                       if (elem.scrollIntoView) {
+                               elem.scrollIntoView();
+                       } else {
+                               (document.documentElement || document.body.parentNode || document.body).scrollTop = elem.offsetTop - 40;
+                       }
                        elem.classList.remove('flash');
                        void elem.offsetWidth;
                        elem.classList.add('flash');