renames/reuses lv-modal and fixes bugs associated with the modal

This commit is contained in:
SimonGschnell
2024-09-19 09:35:36 +02:00
parent b9fd95741d
commit 693313a23b
3 changed files with 16 additions and 16 deletions
+9 -9
View File
@@ -1,7 +1,7 @@
import FhcCalendar from "../../components/Calendar/Calendar.js";
import Phrasen from "../../plugin/Phrasen.js";
import CalendarDate from "../../composables/CalendarDate.js";
import CalendarModal from "../../components/Calendar/CalendarModal.js";
import LvModal from "../../components/Cis/Mylv/LvModal.js";
const app = Vue.createApp({
data() {
@@ -14,7 +14,7 @@ const app = Vue.createApp({
},
components: {
FhcCalendar,
CalendarModal
LvModal
},
computed:{
weekFirstDay: function () {
@@ -35,7 +35,7 @@ const app = Vue.createApp({
showModal: function(event){
this.currentlySelectedEvent = event;
Vue.nextTick(() => {
this.$refs.calendarModal.show();
this.$refs.lvmodal.show();
});
},
updateRange: function (data) {
@@ -96,13 +96,13 @@ const app = Vue.createApp({
template:/*html*/`
<h2>Stundenplan</h2>
<hr>
<calendar-modal v-if="currentlySelectedEvent" :event="currentlySelectedEvent" ref="calendarModal" />
<lv-modal v-if="currentlySelectedEvent" :event="currentlySelectedEvent" ref="lvmodal" />
<fhc-calendar @change:range="updateRange" v-slot="{event, day}" :events="events" initial-mode="week" show-weeks>
<div @click="showModal(event)" type="button" class="d-flex flex-column align-items-center justify-content-evenly h-100">
<span>{{event.orig.topic}}</span>
<span v-for="lektor in event.orig.lektor">{{lektor.kurzbz}}</span>
<span>{{event.orig.ort_kurzbz}}</span>
</div>
<div @click="showModal(event?.orig)" type="button" class="d-flex flex-column align-items-center justify-content-evenly h-100">
<span>{{event?.orig.topic}}</span>
<span v-for="lektor in event?.orig.lektor">{{lektor.kurzbz}}</span>
<span>{{event?.orig.ort_kurzbz}}</span>
</div>
</fhc-calendar>
`
});
@@ -1,6 +1,6 @@
import BsModal from "../Bootstrap/Modal.js";
import Alert from "../Bootstrap/Alert.js";
import LvMenu from "../Cis/Mylv/LvMenu.js"
import BsModal from "../../Bootstrap/Modal.js";
import Alert from "../../Bootstrap/Alert.js";
import LvMenu from "./LvMenu.js"
export default {
components: {
@@ -1,7 +1,7 @@
import Phrasen from '../../mixins/Phrasen.js';
import AbstractWidget from './Abstract.js';
import FhcCalendar from '../Calendar/Calendar.js';
import LvUebersicht from '../Cis/Mylv/LvUebersicht.js';
import LvModal from '../Cis/Mylv/LvModal.js';
import ContentModal from '../Cis/Cms/ContentModal.js'
import CalendarDate from '../../composables/CalendarDate.js';
@@ -12,7 +12,7 @@ export default {
],
components: {
FhcCalendar,
LvUebersicht,
LvModal,
ContentModal,
},
@@ -73,7 +73,7 @@ export default {
showLvUebersicht: function (event){
this.selectedEvent= event;
Vue.nextTick(()=>{
this.$refs.lvUebersicht.show();
this.$refs.lvmodal.show();
});
},
@@ -167,7 +167,7 @@ export default {
},
template: /*html*/`
<div class="dashboard-widget-stundenplan d-flex flex-column h-100">
<lv-uebersicht ref="lvUebersicht" :event="selectedEvent" />
<lv-modal v-if="selectedEvent" ref="lvmodal" :event="selectedEvent" />
<content-modal :contentID="roomInfoContentID" :ort_kurzbz="" dialogClass="modal-lg" ref="contentModal"/>
<fhc-calendar @change:range="updateRange" :initial-date="currentDay" class="border-0" class-header="p-0" @select:day="selectDay" v-model:minimized="minimized" :events="events" no-week-view :show-weeks="false" />
<div v-show="minimized" class="flex-grow-1 overflow-scroll">