From b3dfcdc29543259fd28e7c93252212f044b04efa Mon Sep 17 00:00:00 2001 From: SimonGschnell Date: Mon, 17 Jun 2024 14:01:02 +0200 Subject: [PATCH] the calendar modal is correctly opened when the correct event is called --- application/views/Cis/Stundenplan.php | 4 ++-- public/js/apps/Cis/Stundenplan.js | 21 ++++++++++++++++--- public/js/components/Calendar/Calendar.js | 15 ++----------- .../Cis/Profil/ProfilModal/EditProfil.js | 3 ++- 4 files changed, 24 insertions(+), 19 deletions(-) diff --git a/application/views/Cis/Stundenplan.php b/application/views/Cis/Stundenplan.php index cb8f8a712..99103b373 100755 --- a/application/views/Cis/Stundenplan.php +++ b/application/views/Cis/Stundenplan.php @@ -8,10 +8,10 @@ $includesArray = array( $this->load->view('templates/CISHTML-Header', $includesArray); ?> -
+

Stundenplan


- +
load->view('templates/CISHTML-Footer', $includesArray); ?> diff --git a/public/js/apps/Cis/Stundenplan.js b/public/js/apps/Cis/Stundenplan.js index 25823b193..edcad1da8 100755 --- a/public/js/apps/Cis/Stundenplan.js +++ b/public/js/apps/Cis/Stundenplan.js @@ -1,16 +1,28 @@ import FhcCalendar from "../../components/Calendar/Calendar.js"; +import CalendarModal from '../../components/Calendar/CalendarModal.js'; import Phrasen from "../../plugin/Phrasen.js"; const app = Vue.createApp({ components: { - FhcCalendar + FhcCalendar, + CalendarModal }, data() { return { stunden: [], - events: null + events: null, + currentlySelectedEvent:null, } }, + methods:{ + selectEvent: function(event){ + this.currentlySelectedEvent = event; + Vue.nextTick(()=>{ + this.$refs.calendarModal.show(); + }) + + }, + }, created() { axios.get(FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + '/components/Cis/Stundenplan/Stunden').then(res => { res.data.retval.forEach(std => { @@ -48,7 +60,10 @@ const app = Vue.createApp({ }); }); }); - } + }, + template:` + + ` }); app.config.unwrapInjectedRef = true; app.use(Phrasen); diff --git a/public/js/components/Calendar/Calendar.js b/public/js/components/Calendar/Calendar.js index 4ce70911e..79260e191 100755 --- a/public/js/components/Calendar/Calendar.js +++ b/public/js/components/Calendar/Calendar.js @@ -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*/`
- diff --git a/public/js/components/Cis/Profil/ProfilModal/EditProfil.js b/public/js/components/Cis/Profil/ProfilModal/EditProfil.js index 189dd8f5d..befb733d5 100755 --- a/public/js/components/Cis/Profil/ProfilModal/EditProfil.js +++ b/public/js/components/Cis/Profil/ProfilModal/EditProfil.js @@ -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*/ `