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:39:01 +0000 (23:39 +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 e409a5ac50cf30821761d46d2a839576fe23f3ca..917dada57a5fc1b0c502116643704e7d04ddb8c1 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');