Add web/core/search-help.js

This commit is contained in:
Joshua Laymon 2025-08-14 16:29:30 +00:00
parent c92ad253b6
commit 62bd82b87e

15
web/core/search-help.js Normal file
View File

@ -0,0 +1,15 @@
<script>
document.addEventListener('click', (e) => {
const btn = e.target.closest('.help-toggle');
const panel = document.querySelector((btn && btn.dataset.target) || '#search-help-panel');
if (btn && panel) {
panel.classList.toggle('open');
return;
}
if (panel && panel.classList.contains('open') && !panel.contains(e.target)) {
const clickedHelpButton = e.target.closest('.help-toggle');
if (!clickedHelpButton) panel.classList.remove('open');
}
});
</script>