Added shortcut to search

This commit is contained in:
Alexis
2024-04-05 17:44:49 +02:00
parent fda2e05d99
commit 6368ada51d
2 changed files with 22 additions and 2 deletions

View File

@@ -6,6 +6,7 @@ import { Input } from '@/components/ui/input'
import { PhMagnifyingGlass } from '@phosphor-icons/vue'
import { useCalendarEvents } from '@/stores/events'
import CalendarEventList from './CalendarEventList.vue'
import { useMagicKeys, whenever } from '@vueuse/core'
const { allEvents } = useCalendarEvents()
@@ -34,15 +35,26 @@ function resetSearch() {
searchQuery.value = ''
}
function openDialog() {
modalOpen.value = true
}
function closeDialog() {
modalOpen.value = false
}
// Key combos to deploy modal
const keys = useMagicKeys()
whenever(keys.control_period, () => {
openDialog()
})
</script>
<template>
<Dialog v-model:open="modalOpen" @update:open="resetSearch">
<DialogTrigger>
<Button>
<Button search-slash>
<PhMagnifyingGlass size="20" weight="light" />
Recherche avancée
</Button>