on master help sign in
Docs navigation scrolls to current article on load
7ace837Matilde Park
sass/_main.scss+5
@@ -76,6 +76,11 @@ iframe {
76 font-size: inherit;
76 font-size: inherit;
77 line-height: inherit;
77 line-height: inherit;
78 }
78 }
79+ li a:focus {
80+ outline: 0;
81+ border: none;
82+ -moz-outline-style: none;
83+ }
79}
84}
80
85
81.content-nav-icon {
86.content-nav-icon {
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 (docsNav[link].href === window.location.href) {
338+ docsNav[link].focus()
339+ }
340+ }
341+}
342+
343+if (window.location.href.includes("docs")) docsNavScroll();