Added double click for quick edit
This commit is contained in:
@@ -10,6 +10,8 @@ const props = defineProps<{
|
|||||||
}>()
|
}>()
|
||||||
|
|
||||||
const { areDatesIdentical } = useCalendar()
|
const { areDatesIdentical } = useCalendar()
|
||||||
|
const { revealEditEventModal } = useCalendarEvents()
|
||||||
|
const { lastActiveEvent } = storeToRefs(useCalendarEvents())
|
||||||
|
|
||||||
const spansMultipleDays = Boolean(props.event.startDate && props.event.endDate)
|
const spansMultipleDays = Boolean(props.event.startDate && props.event.endDate)
|
||||||
const isStartEvent = spansMultipleDays && areDatesIdentical(props.tileDate, props.event.startDate)
|
const isStartEvent = spansMultipleDays && areDatesIdentical(props.tileDate, props.event.startDate)
|
||||||
@@ -22,6 +24,12 @@ const eventTitle = computed<string>(() => props.event.title.length <= titleCharL
|
|||||||
// Popover code
|
// Popover code
|
||||||
const isPopoverDetailsOpen = ref<boolean>(false)
|
const isPopoverDetailsOpen = ref<boolean>(false)
|
||||||
|
|
||||||
|
function handleDoubleClick() {
|
||||||
|
isPopoverDetailsOpen.value = false
|
||||||
|
lastActiveEvent.value = { ...props.event }
|
||||||
|
revealEditEventModal()
|
||||||
|
}
|
||||||
|
|
||||||
function handleClosePopover() {
|
function handleClosePopover() {
|
||||||
isPopoverDetailsOpen.value = false
|
isPopoverDetailsOpen.value = false
|
||||||
}
|
}
|
||||||
@@ -58,6 +66,7 @@ function handleClosePopover() {
|
|||||||
'rounded-l-none': isEndEvent
|
'rounded-l-none': isEndEvent
|
||||||
})
|
})
|
||||||
"
|
"
|
||||||
|
@dblclick="handleDoubleClick"
|
||||||
>
|
>
|
||||||
<div class="line-clamp-2 [overflow-wrap:anywhere] hyphens-auto">
|
<div class="line-clamp-2 [overflow-wrap:anywhere] hyphens-auto">
|
||||||
{{ eventTitle }}
|
{{ eventTitle }}
|
||||||
|
|||||||
@@ -67,6 +67,7 @@ function deployDeleteModal() {
|
|||||||
:side="'left'"
|
:side="'left'"
|
||||||
:collision-padding="60"
|
:collision-padding="60"
|
||||||
:hide-when-detached="true"
|
:hide-when-detached="true"
|
||||||
|
:disable-outside-pointer-events="true"
|
||||||
:class="{
|
:class="{
|
||||||
'border-slate-800': !event.category,
|
'border-slate-800': !event.category,
|
||||||
'border-lime-800': event.category?.name === 'naissance',
|
'border-lime-800': event.category?.name === 'naissance',
|
||||||
|
|||||||
Reference in New Issue
Block a user