From db543b5fed5e2f22d9546d9184ee9a745dfa3609 Mon Sep 17 00:00:00 2001 From: Liangbin Lian Date: Fri, 17 Mar 2023 16:36:59 +0800 Subject: [PATCH] luci-mod-status: fix iptables jump on argon theme Signed-off-by: Liangbin Lian --- .../htdocs/luci-static/resources/view/status/iptables.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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'); -- 2.30.2