From 63750298d3d09eda76e181ad5112bc18bfb04ec0 Mon Sep 17 00:00:00 2001 From: Jacques Erasmus Date: Fri, 13 Sep 2019 01:29:44 +0000 Subject: Disable auto-scroll on mobile Disables the auto-scroll on mobile devices --- content/assets/javascripts/docs.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'content/assets/javascripts/docs.js') diff --git a/content/assets/javascripts/docs.js b/content/assets/javascripts/docs.js index 90921797..018c0bb2 100644 --- a/content/assets/javascripts/docs.js +++ b/content/assets/javascripts/docs.js @@ -179,6 +179,12 @@ 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) { -- cgit v1.2.3