mirror of
https://github.com/wahyd4/docsify.git
synced 2026-08-09 21:36:10 +10:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
83d7862505 | ||
|
|
75686f1624 | ||
|
|
780c1e580e | ||
|
|
35dd2e16fa |
@@ -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
@@ -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();
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
@@ -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
@@ -15,7 +15,7 @@ const config = merge({
|
||||
themeColor: '',
|
||||
nameLink: window.location.pathname,
|
||||
autoHeader: false,
|
||||
executeScript: false,
|
||||
executeScript: null,
|
||||
ga: ''
|
||||
}, window.$docsify)
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user