Compare commits

...
3 Commits
Author SHA1 Message Date
qingwei.li db7db5af8b -> v1.6.1 2017-01-10 23:49:06 +08:00
qingwei.li a418096a29 bump 1.6.1 2017-01-10 23:48:49 +08:00
qingwei.li 90b490c9c1 Fixed sidebar bug when the coverpage exist 2017-01-10 23:48:12 +08:00
5 changed files with 13 additions and 5 deletions
+4
View File
@@ -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
View File
@@ -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;
}
})()
}
+2 -2
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -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
View File
@@ -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
}
})()
}