luci-mod-status: log viewers - change focus() to scrollIntoView()
authorPaul Donald <newtwen+github@gmail.com>
Mon, 8 Jul 2024 14:34:31 +0000 (16:34 +0200)
committerPaul Donald <newtwen+github@gmail.com>
Tue, 30 Jul 2024 17:00:37 +0000 (19:00 +0200)
scrollIntoView() is more universally supported and standards tracked.

Closes #7186

Updates 9370bdddaede2feeb581193158d83f5062d5a318

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
(cherry picked from commit 7893f2d08aaa1a0419ede1a695a25781f60e6ba6)

modules/luci-mod-status/htdocs/luci-static/resources/view/status/dmesg.js
modules/luci-mod-status/htdocs/luci-static/resources/view/status/syslog.js

index acddf454f58c1a50507e4be187f45cee4fd5ea02..600aee9c952966c1e4b762bfb547abbdefce0e0e 100644 (file)
@@ -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([], [
index 6ef7d09c70bd7ff94343515a29cd38bd5d853e36..a53f42a77aa243296d48bc07c003a845c47ebd79 100644 (file)
@@ -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([], [