Simplifies layout language selection and js init logic

Signed-off-by: Christopher Rogers <chrissrogers@gmail.com>
This commit is contained in:
Christopher Rogers
2014-04-09 14:45:41 -07:00
parent 68807cd485
commit adf94ffbf6
2 changed files with 46 additions and 52 deletions

View File

@@ -0,0 +1,24 @@
$(function() {
var toc = $("#toc").tocify({
selectors: "h1,h2",
extendPage: false,
theme: "none",
smoothScroll: false,
showEffectSpeed: 0,
hideEffectSpeed: 180,
ignoreSelector: ".toc-ignore",
hashGenerator: 'pretty',
highlightOffset: 60,
scrollTo: -2,
scrollHistory: true,
hashGenerator: function(text, element) {
return element[0].getAttribute('id');
}
}).data("toc-tocify");
// Hack to make already open sections to start opened,
// instead of displaying an ugly animation
setTimeout(function() {
toc.setOption("showEffectSpeed", 180);
},50);
});