[build] 4.1.11

This commit is contained in:
qingwei.li 2017-06-02 22:18:36 +08:00
parent b12f74b159
commit ac28040bd7
No known key found for this signature in database
GPG Key ID: B6DDC2F7AE80B2F4
4 changed files with 13 additions and 6 deletions

View File

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

View File

@ -2889,6 +2889,10 @@ Compiler.prototype.sidebar = function sidebar (text, level) {
* Compile sub sidebar * Compile sub sidebar
*/ */
Compiler.prototype.subSidebar = function subSidebar (level) { Compiler.prototype.subSidebar = function subSidebar (level) {
if (!level) {
this.toc = [];
return
}
var currentPath = this.router.getCurrentPath(); var currentPath = this.router.getCurrentPath();
var ref = this; var ref = this;
var cacheTree = ref.cacheTree; var cacheTree = ref.cacheTree;
@ -3159,9 +3163,12 @@ function renderMixin (proto) {
var activeEl = getAndActive(this.router, '.sidebar-nav', true, true); var activeEl = getAndActive(this.router, '.sidebar-nav', true, true);
if (loadSidebar && activeEl) { if (loadSidebar && activeEl) {
activeEl.parentNode.innerHTML += this.compiler.subSidebar(subMaxLevel); activeEl.parentNode.innerHTML += this.compiler.subSidebar(subMaxLevel);
} else {
// reset toc
this.compiler.subSidebar();
} }
// bind event // bind event
this._bindEventOnRendered(); this._bindEventOnRendered(activeEl);
}; };
proto._bindEventOnRendered = function (activeEl) { proto._bindEventOnRendered = function (activeEl) {
@ -3743,7 +3750,7 @@ initGlobalAPI();
/** /**
* Version * Version
*/ */
Docsify.version = '4.1.10'; Docsify.version = '4.1.11';
/** /**
* Run Docsify * Run Docsify

4
lib/docsify.min.js vendored

File diff suppressed because one or more lines are too long

View File

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