From: Liangbin Lian Date: Fri, 17 Mar 2023 08:36:59 +0000 (+0800) Subject: luci-mod-status: fix iptables jump on argon theme X-Git-Url: http://git.openwrt.org/?a=commitdiff_plain;h=db543b5fed5e2f22d9546d9184ee9a745dfa3609;p=project%2Fluci.git luci-mod-status: fix iptables jump on argon theme Signed-off-by: Liangbin Lian --- diff --git a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/iptables.js b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/iptables.js index 951c31218d..743d95000c 100644 --- a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/iptables.js +++ b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/iptables.js @@ -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');