summaryrefslogtreecommitdiff
path: root/public/vendor
diff options
context:
space:
mode:
authorWu Cheng-Han2015-12-20 11:28:54 -0600
committerWu Cheng-Han2015-12-20 11:28:54 -0600
commit9eb23603f4d30a0822afde7fbd234976557f575a (patch)
tree51de9b06d232d37164c92b9cfdb65e550431da93 /public/vendor
parent45ec05e2ed4962fcd4497cea8b58176f44a9ec3b (diff)
Added support of toc syntax
Diffstat (limited to 'public/vendor')
-rwxr-xr-xpublic/vendor/md-toc.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/public/vendor/md-toc.js b/public/vendor/md-toc.js
index e46afad9..abdd9f56 100755
--- a/public/vendor/md-toc.js
+++ b/public/vendor/md-toc.js
@@ -10,6 +10,7 @@
this.options = options || {};
this.tocLevel = parseInt(options.level) || 0;
this.tocClass = options['class'] || 'toc';
+ this.ulClass = options['ulClass'];
this.tocTop = parseInt(options.top) || 0;
this.elChilds = this.el.children;
if (!this.elChilds.length) return;
@@ -80,7 +81,10 @@
this._tempLists.length = this._tempLists.length - y;
} else {
this._tempLists.push(this._elTitleElement);
- this.tocContent += '<ul class="nav">';
+ if (this.ulClass)
+ this.tocContent += '<ul class="' + this.ulClass + '">';
+ else
+ this.tocContent += '<ul>';
}
} else {
this.tocContent += '</li>';
@@ -93,7 +97,10 @@
}
}
}
- this.tocContent = '<ul class="nav">' + this.tocContent + '</ul>';
+ if (this.ulClass)
+ this.tocContent = '<ul class="' + this.ulClass + '">' + this.tocContent + '</ul>';
+ else
+ this.tocContent = '<ul>' + this.tocContent + '</ul>';
};
Toc.prototype._showToc = function () {