From 4aed321b5e589decb442a4fac0898c035040dc2a Mon Sep 17 00:00:00 2001 From: SimonGschnell Date: Tue, 19 Nov 2024 10:11:49 +0100 Subject: [PATCH] refactor(Calendar Tagesansicht): changes how the logic for opening a modal or showing the lvMenu next to the calendar is handled --- public/css/Cis4/Cis.css | 2 +- public/js/apps/Cis/Stundenplan.js | 21 +----- public/js/components/Calendar/Day.js | 2 +- public/js/components/Calendar/Day/Page.js | 84 +++++++++++++++------ public/js/components/Calendar/Month/Page.js | 7 +- public/js/components/Calendar/Pane.js | 19 ++++- public/js/components/Calendar/Week/Page.js | 7 +- 7 files changed, 91 insertions(+), 51 deletions(-) diff --git a/public/css/Cis4/Cis.css b/public/css/Cis4/Cis.css index c48beed4d..380951b21 100644 --- a/public/css/Cis4/Cis.css +++ b/public/css/Cis4/Cis.css @@ -175,7 +175,7 @@ html { } #cis-header .btn.dropdown-toggle:after, #cis-nav .btn.dropdown-toggle:after { - transition: all 0.2s ease-in-out; + transition: transform 0.2s ease-in-out; } #cis-header .btn.dropdown-toggle.collapsed:after, #cis-nav .btn.dropdown-toggle.collapsed:after { diff --git a/public/js/apps/Cis/Stundenplan.js b/public/js/apps/Cis/Stundenplan.js index 1d37e4d91..d29ba946e 100644 --- a/public/js/apps/Cis/Stundenplan.js +++ b/public/js/apps/Cis/Stundenplan.js @@ -3,6 +3,7 @@ import Phrasen from "../../plugin/Phrasen.js"; import CalendarDate from "../../composables/CalendarDate.js"; import LvModal from "../../components/Cis/Mylv/LvModal.js"; + const app = Vue.createApp({ name: 'StundenplanApp', data() { @@ -17,8 +18,7 @@ const app = Vue.createApp({ } }, components: { - FhcCalendar, - LvModal + FhcCalendar, LvModal }, computed:{ weekFirstDay: function () { @@ -36,20 +36,12 @@ const app = Vue.createApp({ }, methods:{ - setWindowWidth: function () { - this.windowWidth = window.innerWidth; - }, getLvID: function () { this.lv_id = window.location.pathname }, selectDay: function(day){ this.currentDay = day; }, - showDayModal: function (event) { - // only show the modal if the window width is smaller than 1200px - if(this.windowWidth >= 1200) return; - this.showModal(event); - }, showModal: function(event){ this.currentlySelectedEvent = event; Vue.nextTick(() => { @@ -116,13 +108,6 @@ const app = Vue.createApp({ this.loadEvents(); this.getLvID() }, - mounted(){ - this.windowWidth = window.innerWidth; - window.addEventListener('resize', this.setWindowWidth); - }, - beforeUnmount(){ - window.removeEventListener('resize', this.setWindowWidth); - }, //TODO: Stundenplan phrase template:/*html*/`

Stundenplan

@@ -142,7 +127,7 @@ const app = Vue.createApp({