From e133f67de25d379b5f5a5165bdb1c235969f4f84 Mon Sep 17 00:00:00 2001 From: SimonGschnell Date: Thu, 12 Jun 2025 12:32:48 +0200 Subject: [PATCH] fix(LvPlan calendarComponent renderer async modal): updates the logic to display the modal for the lv information --- public/js/components/Cis/LvPlan/LvPlan.js | 41 ++++++++++++++--------- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/public/js/components/Cis/LvPlan/LvPlan.js b/public/js/components/Cis/LvPlan/LvPlan.js index b6d61fcb9..575604d4c 100644 --- a/public/js/components/Cis/LvPlan/LvPlan.js +++ b/public/js/components/Cis/LvPlan/LvPlan.js @@ -28,6 +28,7 @@ const LvPlan = { renderComponents: {}, isModalContentResolved: false, isModalTitleResolved: false, + isShowModal: false, } }, props: { @@ -50,7 +51,17 @@ const LvPlan = { }, inject:["renderers"], watch: { - + modalLoaded:{ + handler: function (newValue) { + if (this.isShowModal && newValue.isModalContentResolved && newValue.isModalTitleResolved) { + this.$nextTick(() => { + if(this.$refs.lvmodal) this.$refs.lvmodal.show(); + this.isShowModal = false; + }); + } + }, + immediate: true + }, weekFirstDay: { handler: async function (newValue) { let data = await this.fetchStudiensemesterDetails(newValue); @@ -76,6 +87,9 @@ const LvPlan = { FhcCalendar, LvModal, LvMenu, lehreinheitEvent, LvInfo }, computed:{ + modalLoaded: function(){ + return { isModalContentResolved: this.isModalContentResolved, isModalTitleResolved:this.isModalTitleResolved}; + }, downloadLinks: function(){ if(!this.studiensemester_start || !this.studiensemester_ende || !this.uid )return; @@ -112,19 +126,11 @@ const LvPlan = { methods:{ modalTitleResolved: function () { this.isModalTitleResolved = true; - if(this.isModalContentResolved && this.isModalTitleResolved) - Vue.nextTick(() => { - if(this.$refs.lvmodal) - this.$refs.lvmodal.show(); - }); + }, modalContentResolved: function () { this.isModalContentResolved = true; - if (this.isModalContentResolved && this.isModalTitleResolved) - Vue.nextTick(() => { - if (this.$refs.lvmodal) - this.$refs.lvmodal.show(); - }); + }, // component renderers fetches from different addons modalTitleComponent(type){ @@ -203,8 +209,12 @@ const LvPlan = { }, showModal: function(event){ this.currentlySelectedEvent = event; - this.isModalTitleResolved = false; - this.isModalContentResolved = false; + if(this.isModalContentResolved && this.isModalTitleResolved){ + if(this.$refs.lvmodal) this.$refs.lvmodal.show(); + } + else{ + this.isShowModal = true; + } }, updateRange: function ({start,end, mounted}) { let checkDate = (date) => { @@ -284,6 +294,7 @@ const LvPlan = { template:/*html*/`