the calendar modal is correctly opened when the correct event is called

This commit is contained in:
SimonGschnell
2024-06-24 14:23:34 +02:00
parent bb9d4bda04
commit b3dfcdc295
4 changed files with 24 additions and 19 deletions
+2 -13
View File
@@ -5,7 +5,7 @@ import CalendarWeek from './Week.js';
import CalendarWeeks from './Weeks.js';
import CalendarMinimized from './Minimized.js';
import CalendarDate from '../../composables/CalendarDate.js';
import CalendarModal from './CalendarModal.js';
// TODO(chris): week/month toggle
@@ -17,7 +17,6 @@ export default {
CalendarWeek,
CalendarWeeks,
CalendarMinimized,
CalendarModal
},
provide() {
return {
@@ -105,15 +104,6 @@ export default {
},
methods: {
handleInput(day) {
// set the event when clicking on the lernveranstaltung in the data
this.currentlySelectedEvent = day[1];
console.log(this.currentlySelectedEvent)
// showing the modal
Vue.nextTick(()=>{
this.$refs.calendarModal.show();
})
console.log(day,"this is the day")
this.$emit(day[0], day[1]);
}
},
@@ -145,9 +135,8 @@ export default {
}).observe(this.$refs.container);
}
},
template: `
template: /*html*/`
<div ref="container" class="fhc-calendar card" :class="sizeClass">
<calendar-modal v-if="currentlySelectedEvent" :event="currentlySelectedEvent" ref="calendarModal" />
<component v-slot="{event}" :is="'calendar-' + mode" @update:mode="mode=$event" @change:range="$emit('change:range',$event)" @input="handleInput" >
<!--Week Page layout-->
<slot :event="event">
@@ -153,7 +153,8 @@ export default {
this.modal = this.$refs.modalContainer.modal;
},
popup(options) {
return BsModal.popup.bind(this)(null, options);
BsModal.popup.bind(this);
return BsModal.popup(null, options);
},
template: /*html*/ `
<bs-modal v-show="!loading" ref="modalContainer" v-bind="$props" body-class="" dialog-class="modal-lg" class="bootstrap-alert" backdrop="false" >