Skip to content

Commit

Permalink
bump: 3.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
QingWei-Li committed Feb 20, 2017
1 parent 780c1e5 commit 75686f1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@

3.0.4 / 2017-02-20
==================

* fix(render): execute script
* fix(render): disable rendering sub list when loadSidebar is false

3.0.3 / 2017-02-19
==================

Expand Down
10 changes: 6 additions & 4 deletions lib/docsify.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ var config = merge({
themeColor: '',
nameLink: window.location.pathname,
autoHeader: false,
executeScript: false,
executeScript: null,
ga: ''
}, window.$docsify);

Expand Down Expand Up @@ -3106,9 +3106,8 @@ function renderMain (html) {
this._renderTo('.markdown-section', html);
// Render sidebar with the TOC
!this.config.loadSidebar && this._renderSidebar();
// execute script
this.config.executeScript && executeScript();

// execute script
if (this.config.executeScript !== false &&
typeof window.Vue !== 'undefined' &&
!executeScript()) {
Expand All @@ -3117,6 +3116,8 @@ function renderMain (html) {
vueVM && vueVM.$destroy && vueVM.$destroy();
window.__EXECUTE_RESULT__ = new window.Vue().$mount('#main');
}, 0);
} else {
this.config.executeScript && executeScript();
}

if (this.config.auto2top) {
Expand All @@ -3135,10 +3136,11 @@ function renderMixin (proto) {
var maxLevel = ref.maxLevel;
var subMaxLevel = ref.subMaxLevel;
var autoHeader = ref.autoHeader;
var loadSidebar = ref.loadSidebar;

this._renderTo('.sidebar-nav', sidebar(text, maxLevel));
var active = getAndActive('.sidebar-nav', true, true);
subSidebar(active, subMaxLevel);
loadSidebar && subSidebar(active, subMaxLevel);
// bind event
this.activeLink = active;
scrollActiveSidebar();
Expand Down
Loading

0 comments on commit 75686f1

Please sign in to comment.