From a5998ce99dafbe49b856f2502b9e4233e8ff3c37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 23 May 2022 22:43:19 +0200 Subject: [PATCH] handle moving an event --- .../Resources/public/vuejs/Calendar/App.vue | 34 +++---------------- 1 file changed, 5 insertions(+), 29 deletions(-) diff --git a/src/Bundle/ChillCalendarBundle/Resources/public/vuejs/Calendar/App.vue b/src/Bundle/ChillCalendarBundle/Resources/public/vuejs/Calendar/App.vue index 7ad4e5705..a7ba187af 100644 --- a/src/Bundle/ChillCalendarBundle/Resources/public/vuejs/Calendar/App.vue +++ b/src/Bundle/ChillCalendarBundle/Resources/public/vuejs/Calendar/App.vue @@ -111,35 +111,10 @@ export default { toggleWeekends: function () { this.calendarOptions.weekends = !this.calendarOptions.weekends; }, - updateEventsSource() { - /* - this.calendarOptions.eventSources = []; - this.calendarOptions.eventSources.push(...this.calendarEvents.selected); - if (window.startDate !== undefined) { - this.calendarOptions.eventSources.push(this.calendarEvents.current); - } - if (this.showMyCalendar) { - this.calendarOptions.eventSources.push(this.calendarEvents.user); - } - - console.log('eventSources', this.calendarOptions.eventSoruces); - - */ - }, onDatesSet(event) { console.log('onDatesSet', event); this.$store.dispatch('setCurrentDatesView', {start: event.start, end: event.end}); }, - unSelectPreviousEvent(event) { - if (event) { - if (typeof event.setProp === 'function') { - event.setProp('backgroundColor', this.previousSelectedEventColor); - event.setProp('borderColor', this.previousSelectedEventColor); - event.setProp('textColor', '#444444'); - event.setProp('title', ''); - } - } - }, onDateSelect(payload) { console.log('onDateSelect', payload); @@ -156,7 +131,11 @@ export default { this.$store.dispatch('setEventTimes', {start: payload.start, end: payload.end}); }, onEventChange(payload) { - this.$store.dispatch('updateEvent', payload); + console.log('onEventChange', payload); + if (this.$store.state.activity.calendarRange !== null) { + throw new Error("not allowed to edit a calendar associated with a calendar range"); + } + this.$store.dispatch('setEventTimes', {start: payload.event.start, end: payload.event.end}); }, onEventClick(payload) { if (payload.event.extendedProps.is !== 'range') { @@ -181,9 +160,6 @@ export default { payload.event.setProp('borderColor', '#ffffff'); } }, - mounted() { - //this.init(); - } }