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:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user