feat(admin): add search with submit and safe-area layout

Add submit-based search to admin books page and switch borrows
search from debounced to submit-based for consistency. Update
layout headers and nav bars to respect mobile safe-area insets
via CSS custom properties.
This commit is contained in:
2026-05-24 22:33:59 +08:00
parent c474d2df2f
commit 86cbd56a99
7 changed files with 43 additions and 20 deletions
+35 -1
View File
@@ -1,6 +1,40 @@
<!doctype html>
<html lang="en">
<html lang="en" class="no-select">
<head>
<script>
if (window.__TAURI_INTERNALS__) {
function allowsSelection(el) {
let cur = el
while (cur) {
if (
cur.tagName === "INPUT" ||
cur.tagName === "TEXTAREA" ||
cur.hasAttribute("data-selectable")
)
return true
cur = cur.parentElement
}
return false
}
document.addEventListener("selectstart", (e) => {
if (!allowsSelection(e.target)) e.preventDefault()
})
document.addEventListener("selectionchange", () => {
const sel = window.getSelection()
if (!sel || sel.isCollapsed) return
const node = sel.anchorNode
if (!node) return
const el = node.nodeType === 3 ? node.parentElement : node
if (el && !allowsSelection(el)) {
sel.removeAllRanges()
}
})
} else {
document.documentElement.classList.remove("no-select")
}
</script>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />