luci-mod-status: log viewers - change focus() to scrollIntoView()

scrollIntoView() is more universally supported and standards tracked.

Closes #7186

Updates 9370bdddae

Signed-off-by: Paul Donald <newtwen+github@gmail.com>
(cherry picked from commit 7893f2d08a)
This commit is contained in:
Paul Donald
2024-07-08 16:34:31 +02:00
parent 18f3914e1b
commit 910cf4daac
2 changed files with 4 additions and 4 deletions

View 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([], [

View 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([], [