Compare commits

...
4 Commits
Author SHA1 Message Date
qingwei.li 83d7862505 -> v3.0.4 2017-02-20 08:59:43 +08:00
qingwei.li 75686f1624 bump: 3.0.4 2017-02-20 08:59:38 +08:00
qingwei.li 780c1e580e fix(render): execute script 2017-02-20 08:57:09 +08:00
qingwei.li 35dd2e16fa fix(render): disable rendering sub list when loadSidebar is false 2017-02-19 23:23:43 +08:00
6 changed files with 20 additions and 11 deletions
+6
View File
@@ -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
==================
+6 -4
View File
@@ -74,7 +74,7 @@ var config = merge({
themeColor: '',
nameLink: window.location.pathname,
autoHeader: false,
executeScript: false,
executeScript: null,
ga: ''
}, window.$docsify);
@@ -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()) {
@@ -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) {
@@ -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();
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "docsify",
"version": "3.0.3",
"version": "3.0.4",
"description": "A magical documentation generator.",
"main": "lib/docsify.js",
"files": [
+1 -1
View File
@@ -15,7 +15,7 @@ const config = merge({
themeColor: '',
nameLink: window.location.pathname,
autoHeader: false,
executeScript: false,
executeScript: null,
ga: ''
}, window.$docsify)
+5 -4
View File
@@ -28,9 +28,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()) {
@@ -39,6 +38,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) {
@@ -53,11 +54,11 @@ export function renderMixin (proto) {
}
proto._renderSidebar = function (text) {
const { maxLevel, subMaxLevel, autoHeader } = this.config
const { maxLevel, subMaxLevel, autoHeader, loadSidebar } = this.config
this._renderTo('.sidebar-nav', sidebar(text, maxLevel))
const active = getAndActive('.sidebar-nav', true, true)
subSidebar(active, subMaxLevel)
loadSidebar && subSidebar(active, subMaxLevel)
// bind event
this.activeLink = active
scrollActiveSidebar()