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>
Mon, 8 Jul 2024 14:34:35 +0000 (16:34 +0200)
scrollIntoView() is more universally supported and standards tracked.

Closes #7186

Updates 9370bdddaede2feeb581193158d83f5062d5a318

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
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 45b483962d5f1a4e6b0a2e597de4801fa704a83e..aad0383646c3fcde869c25c07b129f1d1c6d5831 100644 (file)
@@ -38,7 +38,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', { 
@@ -47,7 +47,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 2e3d705c222059609dba6918f1b15b9d82b4bd86..2aa3c46093686e1dec488d9971979fd46be72847 100644 (file)
@@ -43,7 +43,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', { 
@@ -52,7 +52,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([], [