From e6f8f43b6ca5ff00d33b3a539e67eb2255fa1dd0 Mon Sep 17 00:00:00 2001 From: sptaule Date: Sat, 29 Jan 2022 14:42:09 +0100 Subject: Improve responsive, icons, refactor search, update readme --- templates/partials/doc/toc_script.html | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'templates/partials/doc/toc_script.html') diff --git a/templates/partials/doc/toc_script.html b/templates/partials/doc/toc_script.html index df115b0..1453a69 100644 --- a/templates/partials/doc/toc_script.html +++ b/templates/partials/doc/toc_script.html @@ -11,11 +11,13 @@ const navSections = new Array(tocItems.length); */ window.addEventListener('scroll', function() { - if (window.scrollY >= menuBarHeight) { - document.getElementById('main-toc-menu').classList.add('fixed', 'top-0', 'left-0'); - document.getElementById('main-toc-menu').style.width = mainTocMenuWidth + 'px'; - } else { - document.getElementById('main-toc-menu').classList.remove('fixed', 'top-0', 'left-0'); + if (window.screen.width >= 1280) { + if (window.scrollY >= menuBarHeight) { + document.getElementById('main-toc-menu').classList.add('fixed', 'top-0', 'left-0'); + document.getElementById('main-toc-menu').style.width = mainTocMenuWidth + 'px'; + } else { + document.getElementById('main-toc-menu').classList.remove('fixed', 'top-0', 'left-0'); + } } }); -- cgit v1.2.3