From 6368ada51d46718e8eabdb265667ce1346400d0e Mon Sep 17 00:00:00 2001 From: Alexis <35.alexis.pele@gmail.com> Date: Fri, 5 Apr 2024 17:44:49 +0200 Subject: [PATCH] Added shortcut to search --- src/components/calendar/CalendarMenuSearch.vue | 14 +++++++++++++- src/components/ui/button/Button.vue | 10 +++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/components/calendar/CalendarMenuSearch.vue b/src/components/calendar/CalendarMenuSearch.vue index 0a010de..4b1005c 100644 --- a/src/components/calendar/CalendarMenuSearch.vue +++ b/src/components/calendar/CalendarMenuSearch.vue @@ -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() +})