mirror of
https://github.com/placeholder-soft/prodigyapi.git
synced 2026-04-28 11:55:00 +08:00
Simplifies layout language selection and js init logic
Signed-off-by: Christopher Rogers <chrissrogers@gmail.com>
This commit is contained in:
24
source/javascripts/init.js
Normal file
24
source/javascripts/init.js
Normal 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);
|
||||
});
|
||||
Reference in New Issue
Block a user