Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-docs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'content/assets/javascripts/docs.js')
-rw-r--r--content/assets/javascripts/docs.js21
1 files changed, 1 insertions, 20 deletions
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;
- }
- });
});
})();