file selection scroll behavior

This commit is contained in:
ed 2021-07-27 12:13:00 +02:00
parent d337ecdb20
commit fb729e5166
3 changed files with 8 additions and 1 deletions

View file

@ -236,6 +236,7 @@ the browser has the following hotkeys (assumes qwerty, ignores actual layout)
* `F2` rename selected file/folder * `F2` rename selected file/folder
* when a file/folder is selected (in not-grid-view): * when a file/folder is selected (in not-grid-view):
* `Up/Down` move cursor * `Up/Down` move cursor
* shift+`Up/Down` move cursor and scroll viewport
* `Space` toggle file selection * `Space` toggle file selection
* `Ctrl-A` toggle select all * `Ctrl-A` toggle select all
* when playing audio: * when playing audio:

View file

@ -166,6 +166,10 @@ body {
padding: .3em 0; padding: .3em 0;
scroll-margin-top: 45vh; scroll-margin-top: 45vh;
} }
#files tr {
scroll-margin-top: 25vh;
scroll-margin-bottom: 20vh;
}
#files tbody div a { #files tbody div a {
color: #f5a; color: #f5a;
} }

View file

@ -2031,7 +2031,9 @@ document.onkeydown = function (e) {
var el = ae[d + 'ElementSibling']; var el = ae[d + 'ElementSibling'];
if (el) { if (el) {
el.focus(); el.focus();
if (e.shiftKey)
document.documentElement.scrollTop += (d == 'next' ? 1 : -1) * el.offsetHeight; document.documentElement.scrollTop += (d == 'next' ? 1 : -1) * el.offsetHeight;
return ev(e); return ev(e);
} }
} }