Made Gumshoe contingent upon a TOC being present. This prevents a console error on pages without a TOC. (#2124)

This commit is contained in:
Jeckari 2019-04-12 08:42:10 -07:00 committed by Michael Rose
parent 44760c989e
commit cf0c046dd2
2 changed files with 17 additions and 18 deletions

View file

@ -74,22 +74,24 @@ $(document).ready(function() {
}); });
// Gumshoe scroll spy init // Gumshoe scroll spy init
var spy = new Gumshoe("nav.toc a", { if($("nav.toc").length > 0) {
// Active classes var spy = new Gumshoe("nav.toc a", {
navClass: "active", // applied to the nav list item // Active classes
contentClass: "active", // applied to the content navClass: "active", // applied to the nav list item
contentClass: "active", // applied to the content
// Nested navigation // Nested navigation
nested: false, // if true, add classes to parents of active link nested: false, // if true, add classes to parents of active link
nestedClass: "active", // applied to the parent items nestedClass: "active", // applied to the parent items
// Offset & reflow // Offset & reflow
offset: 20, // how far from the top of the page to activate a content area offset: 20, // how far from the top of the page to activate a content area
reflow: true, // if true, listen for reflows reflow: true, // if true, listen for reflows
// Event support // Event support
events: true // if true, emit custom events events: true // if true, emit custom events
}); });
}
// add lightbox class to all image links // add lightbox class to all image links
$( $(

File diff suppressed because one or more lines are too long