[build] 4.3.12

This commit is contained in:
qingwei.li 2017-10-15 21:26:49 +08:00
parent a3ab37952d
commit 4a9d594f7c
5 changed files with 18 additions and 11 deletions

View File

@ -1,6 +1,6 @@
![logo](_media/icon.svg)
# docsify <small>4.3.11</small>
# docsify <small>4.3.12</small>
> A magical documentation site generator.

View File

@ -3226,6 +3226,10 @@ function highlight () {
}
}
function getNavKey (path, id) {
return (path + "?id=" + id)
}
function scrollActiveSidebar (router) {
var cover = find('.cover.show');
coverHeight = cover ? cover.offsetHeight : 0;
@ -3240,7 +3244,10 @@ function scrollActiveSidebar (router) {
var href = a.getAttribute('href');
if (href !== '/') {
href = router.parse(href).query.id;
var ref = router.parse(href);
var id = ref.query.id;
var path = ref.path;
if (id) { href = getNavKey(path, id); }
}
if (href) { nav[decodeURIComponent(href)] = li; }
@ -3258,13 +3265,13 @@ function scrollActiveSidebar (router) {
});
}
function scrollIntoView (id) {
function scrollIntoView (path, id) {
if (!id) { return }
var section = find('#' + id);
section && scrollTo(section);
var li = nav[id];
var li = nav[getNavKey(path, id)];
var sidebar = getNode('.sidebar');
var active = find(sidebar, 'li.active');
active && active.classList.remove('active');
@ -3618,7 +3625,7 @@ var HashHistory = (function (History$$1) {
var query = '';
var hashIndex = path.indexOf('#');
if (hashIndex) {
if (hashIndex >= 0) {
path = path.slice(hashIndex + 1);
}
@ -3782,7 +3789,7 @@ function initRouter (vm) {
function eventMixin (proto) {
proto.$resetEvents = function () {
scrollIntoView(this.route.query.id);
scrollIntoView(this.route.path, this.route.query.id);
getAndActive(this.router, 'nav');
};
}
@ -3983,7 +3990,7 @@ initGlobalAPI();
/**
* Version
*/
Docsify.version = '4.3.11';
Docsify.version = '4.3.12';
/**
* Run Docsify

4
lib/docsify.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -37,5 +37,5 @@
"integrity": "sha1-6DWIAbhrg7F1YNTjw4LXrvIQCUQ="
}
},
"version": "4.3.11"
"version": "4.3.12"
}

View File

@ -1,6 +1,6 @@
{
"name": "docsify-server-renderer",
"version": "4.3.11",
"version": "4.3.12",
"description": "docsify server renderer",
"author": {
"name": "qingwei-li",