theme: let browser scroll page on CTRL+f #242

This commit is contained in:
Sören Weber 2022-05-30 15:10:35 +02:00
parent 368e41790e
commit 4dbe1bfb1d
No known key found for this signature in database
GPG key ID: 07D17FF580AE7589
2 changed files with 7 additions and 6 deletions

View file

@ -56,7 +56,7 @@ body {
height: 100%;
justify-content: flex-end;
line-height: 1.574;
overflow: hidden; /* to avoid browser scrollbar to flicker before we create our own */
/* overflow: hidden; PSC removed for #242 #243 #244; to avoid browser scrollbar to flicker before we create our own */
width: 100%;
}

View file

@ -323,24 +323,25 @@ function initMenuScrollbar(){
// to scroll the body
var n = document.querySelector('body').matches('.sidebar-flyout');
if( n ){
psm.scrollbarY.focus();
psm && psm.scrollbarY.focus();
}
else{
psc.scrollbarY.focus();
psc && psc.scrollbarY.focus();
}
}
});
// scrollbars will install their own keyboard handlers
// that need to be executed inbetween our own handlers
var psm = new PerfectScrollbar('#content-wrapper');
var psc = new PerfectScrollbar(content);
// PSC removed for #242 #243 #244
// var psc = new PerfectScrollbar(content);
document.addEventListener('keydown', function(){
// if we facked initial scrolling, we want to
// remove the focus to not leave visual markers on
// the scrollbar
if( autofocus ){
psc.scrollbarY.blur();
psm.scrollbarY.blur();
psc && psc.scrollbarY.blur();
psm && psm.scrollbarY.blur();
autofocus = false;
}
});