This commit is contained in:
@@ -124,7 +124,11 @@ function initSidebarRail() {
|
||||
|
||||
btn.addEventListener('click', () => {
|
||||
if (action === 'search') {
|
||||
document.getElementById('search-box')?.focus();
|
||||
if (typeof window.openSearchModal === 'function') {
|
||||
window.openSearchModal();
|
||||
} else {
|
||||
document.getElementById('search-box')?.focus();
|
||||
}
|
||||
return;
|
||||
}
|
||||
const isExpanded = sidebar.classList.contains('expanded');
|
||||
@@ -882,6 +886,7 @@ function hookSearchResults() {
|
||||
e.stopPropagation();
|
||||
resultsBox.innerHTML = '';
|
||||
if (searchBox) searchBox.value = '';
|
||||
window.closeSearchModal?.();
|
||||
|
||||
let resolved;
|
||||
try { resolved = new URL(url, location.href); } catch { return; }
|
||||
@@ -907,6 +912,7 @@ function hookSearchResults() {
|
||||
if (!url) return;
|
||||
resultsBox.innerHTML = '';
|
||||
searchBox.value = '';
|
||||
window.closeSearchModal?.();
|
||||
let resolved;
|
||||
try { resolved = new URL(url, location.href); } catch { return; }
|
||||
openNote(resolved.pathname, active.textContent.trim(), resolved.hash);
|
||||
|
||||
Reference in New Issue
Block a user