mirror of
https://github.com/bookorbit/bookorbit.git
synced 2026-11-03 00:11:37 -06:00
refactor(reader): extract closeFind to avoid Prettier multiline handler
This commit is contained in:
@@ -282,7 +282,7 @@ function onKeyDown(e: KeyboardEvent) {
|
||||
e.preventDefault()
|
||||
showFind.value = true
|
||||
} else if (e.key === 'Escape') {
|
||||
showFind.value = false
|
||||
closeFind()
|
||||
showZoomMenu.value = false
|
||||
}
|
||||
}
|
||||
@@ -292,6 +292,11 @@ function rotate() {
|
||||
rotation.value = ((rotation.value + 90) % 360) as 0 | 90 | 180 | 270
|
||||
}
|
||||
|
||||
function closeFind() {
|
||||
showFind.value = false
|
||||
findQuery.value = ''
|
||||
}
|
||||
|
||||
// ── Find ──────────────────────────────────────────────────────────────────────
|
||||
watch(findQuery, (q) => {
|
||||
if (!q.trim()) {
|
||||
@@ -478,13 +483,7 @@ const progressPct = computed(() => (totalPages.value ? Math.round((currentPage.v
|
||||
@keydown.escape="showFind = false"
|
||||
/>
|
||||
<span v-if="findQuery" class="text-xs text-white/40 tabular-nums shrink-0">{{ findMatches }} match{{ findMatches !== 1 ? 'es' : '' }}</span>
|
||||
<button
|
||||
class="pdf-btn w-6 h-6"
|
||||
@click="
|
||||
showFind = false
|
||||
findQuery = ''
|
||||
"
|
||||
>
|
||||
<button class="pdf-btn w-6 h-6" @click="closeFind">
|
||||
<X :size="12" />
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -5,28 +5,28 @@
|
||||
{
|
||||
"idx": 0,
|
||||
"version": "7",
|
||||
"when": 1767183170461,
|
||||
"when": 1767351466197,
|
||||
"tag": "0000_init_schema",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 1,
|
||||
"version": "7",
|
||||
"when": 1767183170461,
|
||||
"when": 1767351466197,
|
||||
"tag": "0001_lethal_pixie",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 2,
|
||||
"version": "7",
|
||||
"when": 1767183170461,
|
||||
"when": 1767351466197,
|
||||
"tag": "0002_powerful_thundra",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 3,
|
||||
"version": "7",
|
||||
"when": 1767183170461,
|
||||
"when": 1767351466197,
|
||||
"tag": "0003_reading_progress_by_file",
|
||||
"breakpoints": true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user