Skip to content

Commit

Permalink
luci-mod-status: log viewers - change focus() to scrollIntoView()
Browse files Browse the repository at this point in the history
scrollIntoView() is more universally supported and standards tracked.

Closes openwrt#7186

Updates 9370bdd

Signed-off-by: Paul Donald <[email protected]>
  • Loading branch information
systemcrash committed Jul 8, 2024
1 parent 8dc130d commit 7893f2d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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', {
Expand All @@ -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([], [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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', {
Expand All @@ -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([], [
Expand Down

0 comments on commit 7893f2d

Please sign in to comment.