From 021e954538bd2729e2d23c17be2d68c006b2b2b1 Mon Sep 17 00:00:00 2001 From: Daria Golova Date: Fri, 18 Nov 2022 16:17:41 +0300 Subject: [PATCH] =?UTF-8?q?WIP=20=D0=9F=D0=BE=D0=B7=D0=B8=D1=86=D0=B8?= =?UTF-8?q?=D0=BE=D0=BD=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20?= =?UTF-8?q?descriptionCard=20=D1=81=D0=B2=D0=B5=D1=80=D1=85=D1=83-=D1=81?= =?UTF-8?q?=D0=BD=D0=B8=D0=B7=D1=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/calendar/TheCalendar.vue | 2 +- .../CalendarEventDescriptionCard.vue | 20 ++++--------------- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/src/pages/calendar/TheCalendar.vue b/src/pages/calendar/TheCalendar.vue index 2da60fc..0961584 100644 --- a/src/pages/calendar/TheCalendar.vue +++ b/src/pages/calendar/TheCalendar.vue @@ -69,7 +69,7 @@ export default { selectedEvent: {}, showModal: false, timeInformation: { - dayStartTime: "00:00", + dayStartTime: "08:00", dayEndTime: "20:00", }, eventsData: [], diff --git a/src/pages/calendar/components/CalendarEventDescriptionCard.vue b/src/pages/calendar/components/CalendarEventDescriptionCard.vue index 9df6dfc..d470769 100644 --- a/src/pages/calendar/components/CalendarEventDescriptionCard.vue +++ b/src/pages/calendar/components/CalendarEventDescriptionCard.vue @@ -122,25 +122,13 @@ export default { const cardRect = this.$refs.descriptionCard.getBoundingClientRect(); const bodyRect = this.scheduleBodyRef.getBoundingClientRect(); const bodyHeight = this.scheduleBodyRef.clientHeight + bodyRect.y - 20; - const bodyWidth = this.scheduleBodyRef.clientWidth; - console.log(cardRect.x, cardRect.width, bodyWidth); - if (cardRect.x + 2 * cardRect.width < bodyWidth) { + if (cardRect.y + cardRect.height > bodyHeight) { this.position = { - top: 0, - right: `-${cardRect.width + 8}px`, - }; - } else if (cardRect.x - 84 > bodyRect.x) { - this.position = { - top: 0, - left: `-${cardRect.width + 8}px`, - }; - } else if (cardRect.y + cardRect.height < bodyHeight) { - this.position = { - "margin-top": "8px", + top: `-${cardRect.height + 8}px`, }; } else this.position = { - top: `-${cardRect.height + 8}px`, + "margin-top": "8px", }; }, }; @@ -148,7 +136,7 @@ export default {