mirror of
https://github.com/wahyd4/docsify.git
synced 2026-08-09 21:36:10 +10:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
db7db5af8b | ||
|
|
a418096a29 | ||
|
|
90b490c9c1 |
@@ -1,3 +1,7 @@
|
||||
## 1.6.1
|
||||
### Bug fixes
|
||||
- Fixed sidebar bug when the coverpage exist
|
||||
|
||||
## 1.6.0
|
||||
### Features
|
||||
- Improve sidebar performance. The active item is automatically scrolled in the visible view.
|
||||
|
||||
+3
-1
@@ -216,7 +216,7 @@ function scrollActiveSidebar () {
|
||||
|
||||
li.classList.add('active');
|
||||
active = li;
|
||||
!hoveredOverSidebar && active.scrollIntoView();
|
||||
!hoveredOverSidebar && sticky.isSticky && active.scrollIntoView();
|
||||
}
|
||||
|
||||
window.removeEventListener('scroll', highlight);
|
||||
@@ -293,8 +293,10 @@ function sticky () {
|
||||
return (function () {
|
||||
if (window.pageYOffset >= coverHeight || dom.classList.contains('hidden')) {
|
||||
document.body.classList.add('sticky');
|
||||
sticky.isSticky = true;
|
||||
} else {
|
||||
document.body.classList.remove('sticky');
|
||||
sticky.isSticky = false;
|
||||
}
|
||||
})()
|
||||
}
|
||||
|
||||
Vendored
+2
-2
File diff suppressed because one or more lines are too long
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "docsify",
|
||||
"version": "1.6.0",
|
||||
"version": "1.6.1",
|
||||
"description": "A magical documentation generator.",
|
||||
"main": "lib/docsify.js",
|
||||
"files": [
|
||||
|
||||
+3
-1
@@ -48,7 +48,7 @@ export function scrollActiveSidebar () {
|
||||
|
||||
li.classList.add('active')
|
||||
active = li
|
||||
!hoveredOverSidebar && active.scrollIntoView()
|
||||
!hoveredOverSidebar && sticky.isSticky && active.scrollIntoView()
|
||||
}
|
||||
|
||||
window.removeEventListener('scroll', highlight)
|
||||
@@ -125,8 +125,10 @@ export function sticky () {
|
||||
return (function () {
|
||||
if (window.pageYOffset >= coverHeight || dom.classList.contains('hidden')) {
|
||||
document.body.classList.add('sticky')
|
||||
sticky.isSticky = true
|
||||
} else {
|
||||
document.body.classList.remove('sticky')
|
||||
sticky.isSticky = false
|
||||
}
|
||||
})()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user