From 67783d67fac773a3be1ab2a3bf9e40f1692867eb Mon Sep 17 00:00:00 2001 From: David O'Regan Date: Thu, 18 Jun 2020 23:21:50 +0000 Subject: Docs sidebar re-design --- content/assets/javascripts/docs.js | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) (limited to 'content/assets/javascripts/docs.js') diff --git a/content/assets/javascripts/docs.js b/content/assets/javascripts/docs.js index e19a305f..61d3c1cb 100644 --- a/content/assets/javascripts/docs.js +++ b/content/assets/javascripts/docs.js @@ -1,5 +1,5 @@ --- -version: 2 +version: 3 --- var NAV_INLINE_BREAKPOINT = 1100; @@ -81,24 +81,5 @@ function toggleNavigation() { } }); - // Adds the ability to auto-scroll to the active item in the TOC - $(window).on('activate.bs.scrollspy', function() { - const isMobile = window.matchMedia('(max-width: 1099px)').matches; - - if(isMobile) { - return; - } - - const activeAnchors = document.querySelectorAll('#markdown-toc .nav-link.active'); - - if(activeAnchors.length) { - const sidebarAnchorOffset = 45; - const lastActiveAnchor = activeAnchors[activeAnchors.length -1]; - const sidebar = document.getElementById('doc-nav'); - // Takes the last active anchor in the tree and scrolls it into view. - lastActiveAnchor.scrollIntoView(); - sidebar.scrollTop -= sidebarAnchorOffset; - } - }); }); })(); -- cgit v1.2.3