Tweak style

This commit is contained in:
qingwei.li 2017-01-11 18:41:40 +08:00
commit 458e262a26
2 changed files with 5 additions and 3 deletions

View file

@ -48,7 +48,7 @@ export function scrollActiveSidebar () {
li.classList.add('active')
active = li
!hoveredOverSidebar && sticky.isSticky && active.scrollIntoView()
!hoveredOverSidebar && !sticky.noSticky && active.scrollIntoView()
}
window.removeEventListener('scroll', highlight)
@ -125,10 +125,10 @@ export function sticky () {
return (function () {
if (window.pageYOffset >= coverHeight || dom.classList.contains('hidden')) {
document.body.classList.add('sticky')
sticky.isSticky = true
sticky.noSticky = false
} else {
document.body.classList.remove('sticky')
sticky.isSticky = false
sticky.noSticky = true
}
})()
}