From 0c599b769ac6e214c31d5c5366d34e6a7204e605 Mon Sep 17 00:00:00 2001 From: Richard Iannone Date: Wed, 22 Apr 2026 15:27:38 -0400 Subject: [PATCH] Move mobile sidebar toggle to navbar-widgets --- great_docs/assets/navbar-style.js | 51 ++--------------------------- great_docs/assets/navbar-widgets.js | 48 +++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 49 deletions(-) diff --git a/great_docs/assets/navbar-style.js b/great_docs/assets/navbar-style.js index 9a6d054..460cc61 100644 --- a/great_docs/assets/navbar-style.js +++ b/great_docs/assets/navbar-style.js @@ -101,52 +101,5 @@ mql.addEventListener("change", update); })(); -/* Widget collection is handled by navbar-widgets.js (always loaded). */ - -/** - * Mobile sidebar toggle → menu overlay redirect. - * - * On mobile (< 992px) the sidebar toggle button in the Title Bar - * (.quarto-btn-toggle) opens the polished menu overlay (same as the - * 'm'/'n' keyboard shortcut) instead of Bootstrap's collapse sidebar. - * This gives a smooth fade-in/slide, rounded card, backdrop blur, and - * auto-scroll to the current page — matching the desktop overlay UX. - */ -(function () { - "use strict"; - - var mql = window.matchMedia("(max-width: 991.98px)"); - - function intercept(e) { - if (!mql.matches) return; // desktop — let Bootstrap handle it - if (!window.__gdMenu) return; // keyboard-nav.js not loaded yet - - // Stop Bootstrap collapse and Quarto headroom toggle - e.preventDefault(); - e.stopPropagation(); - - if (window.__gdMenu.isOpen()) { - window.__gdMenu.hide(); - } else { - window.__gdMenu.show(); - } - } - - function attach() { - // The secondary-nav has two clickable elements: the