Fix search module not showing on desktop

Remove Bootstrap collapse classes that were hiding the search on
desktop. Use CSS media queries instead: hidden on mobile by default,
visible on desktop. JS toggles .show class on mobile via the
search-toggler button.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-07 21:10:21 -05:00
parent d6c4af1849
commit d318a365a0
3 changed files with 21 additions and 2 deletions

View File

@@ -539,6 +539,20 @@
});
}
/**
* Toggle search on mobile via .show class
*/
function initSearchToggle() {
var btn = doc.querySelector(".search-toggler");
var target = doc.getElementById("headerSearchCollapse");
if (!btn || !target) return;
btn.addEventListener("click", function () {
var isOpen = target.classList.toggle("show");
btn.setAttribute("aria-expanded", isOpen ? "true" : "false");
});
}
/**
* Run all template JS initializations
*/
@@ -563,6 +577,7 @@
// Init features
initDrawers();
initBackTop();
initSearchToggle();
initSidebarAccordion();
}