luci-mod-status: fix iptables jump on argon theme 6295/head
authorLiangbin Lian <jjm2473@gmail.com>
Fri, 17 Mar 2023 08:36:59 +0000 (16:36 +0800)
committerLiangbin Lian <jjm2473@gmail.com>
Fri, 17 Mar 2023 08:38:15 +0000 (16:38 +0800)
Signed-off-by: Liangbin Lian <jjm2473@gmail.com>
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');