on master help sign in
Merge pull request #158 from matildepark/docs-scrolling
37083fcMorgan Sutherland
static/scripts.js+12
@@ -329,3 +329,15 @@ if (document.readyState === "complete" ||
329 initHotKeys();
329 initHotKeys();
330 });
330 });
331}
331}
332+
333+// Scroll to current document in nav list.
334+let docsNavScroll = function() {
335+ let docsNav = document.querySelectorAll("ul.content-nav__index a")
336+ for (let link in docsNav) {
337+ if (window.location.href.includes(docsNav[link].href)) {
338+ docsNav[link].scrollIntoView()
339+ }
340+ }
341+}
342+
343+if (window.location.href.includes("docs")) docsNavScroll();