From 910cf4daac5b6315269d3de33f7007dbe1a9c170 Mon Sep 17 00:00:00 2001 From: Paul Donald Date: Mon, 8 Jul 2024 16:34:31 +0200 Subject: [PATCH] luci-mod-status: log viewers - change focus() to scrollIntoView() scrollIntoView() is more universally supported and standards tracked. Closes #7186 Updates 9370bdddaede2feeb581193158d83f5062d5a318 Signed-off-by: Paul Donald (cherry picked from commit 7893f2d08aaa1a0419ede1a695a25781f60e6ba6) --- .../htdocs/luci-static/resources/view/status/dmesg.js | 4 ++-- .../htdocs/luci-static/resources/view/status/syslog.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/dmesg.js b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/dmesg.js index acddf454f5..600aee9c95 100644 --- a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/dmesg.js +++ b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/dmesg.js @@ -22,7 +22,7 @@ return view.extend({ }, _('Scroll to tail', 'scroll to bottom (the tail) of the log file') ); scrollDownButton.addEventListener('click', function() { - scrollUpButton.focus(); + scrollUpButton.scrollIntoView(); }); var scrollUpButton = E('button', { @@ -31,7 +31,7 @@ return view.extend({ }, _('Scroll to head', 'scroll to top (the head) of the log file') ); scrollUpButton.addEventListener('click', function() { - scrollDownButton.focus(); + scrollDownButton.scrollIntoView(); }); return E([], [ diff --git a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/syslog.js b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/syslog.js index 6ef7d09c70..a53f42a77a 100644 --- a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/syslog.js +++ b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/syslog.js @@ -28,7 +28,7 @@ return view.extend({ }, _('Scroll to tail', 'scroll to bottom (the tail) of the log file') ); scrollDownButton.addEventListener('click', function() { - scrollUpButton.focus(); + scrollUpButton.scrollIntoView(); }); var scrollUpButton = E('button', { @@ -37,7 +37,7 @@ return view.extend({ }, _('Scroll to head', 'scroll to top (the head) of the log file') ); scrollUpButton.addEventListener('click', function() { - scrollDownButton.focus(); + scrollDownButton.scrollIntoView(); }); return E([], [ -- 2.30.2