Fixed sidebar bug when the coverpage exist
This commit is contained in:
parent
7915027418
commit
90b490c9c1
2 changed files with 7 additions and 1 deletions
|
|
@ -1,3 +1,7 @@
|
||||||
|
## 1.6.1
|
||||||
|
### Bug fixes
|
||||||
|
- Fixed sidebar bug when the coverpage exist
|
||||||
|
|
||||||
## 1.6.0
|
## 1.6.0
|
||||||
### Features
|
### Features
|
||||||
- Improve sidebar performance. The active item is automatically scrolled in the visible view.
|
- Improve sidebar performance. The active item is automatically scrolled in the visible view.
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ export function scrollActiveSidebar () {
|
||||||
|
|
||||||
li.classList.add('active')
|
li.classList.add('active')
|
||||||
active = li
|
active = li
|
||||||
!hoveredOverSidebar && active.scrollIntoView()
|
!hoveredOverSidebar && sticky.isSticky && active.scrollIntoView()
|
||||||
}
|
}
|
||||||
|
|
||||||
window.removeEventListener('scroll', highlight)
|
window.removeEventListener('scroll', highlight)
|
||||||
|
|
@ -125,8 +125,10 @@ export function sticky () {
|
||||||
return (function () {
|
return (function () {
|
||||||
if (window.pageYOffset >= coverHeight || dom.classList.contains('hidden')) {
|
if (window.pageYOffset >= coverHeight || dom.classList.contains('hidden')) {
|
||||||
document.body.classList.add('sticky')
|
document.body.classList.add('sticky')
|
||||||
|
sticky.isSticky = true
|
||||||
} else {
|
} else {
|
||||||
document.body.classList.remove('sticky')
|
document.body.classList.remove('sticky')
|
||||||
|
sticky.isSticky = false
|
||||||
}
|
}
|
||||||
})()
|
})()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue