mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-23 07:47:54 +00:00
theme: let browser scroll page on CTRL+f #242
This commit is contained in:
parent
368e41790e
commit
4dbe1bfb1d
2 changed files with 7 additions and 6 deletions
|
@ -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%;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue