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%;
|
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%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue