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%; height: 100%;
justify-content: flex-end; justify-content: flex-end;
line-height: 1.574; 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%; width: 100%;
} }

View file

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