From 41b640a1eadf723e39a7116dae8b49adfd2976ad Mon Sep 17 00:00:00 2001 From: Daru13 Date: Sat, 24 Nov 2018 03:14:18 +0100 Subject: [PATCH] Ensure time slot and event grids have the same number of columns. --- event/static/js/calendar.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/event/static/js/calendar.js b/event/static/js/calendar.js index 9256c3b..4002700 100644 --- a/event/static/js/calendar.js +++ b/event/static/js/calendar.js @@ -53,6 +53,7 @@ class Calendar { this.createEventContainer(); this.createEventDetailsContainer(); + this.updateTimeSlotContainerGridStyle(); this.updateEventContainerGridStyle(); this.createTimeSlots(); @@ -153,9 +154,16 @@ class Calendar { } } + updateTimeSlotContainerGridStyle () { + this.timeSlotsContainerNode.css("grid-template-columns", + `repeat(${this.nbHoursToDisplay}, ${100 / this.nbHoursToDisplay }%)`); + } + updateTimeSlots () { this.timeSlotsContainerNode.empty(); + this.createTimeSlots(); + this.updateTimeSlotContainerGridStyle(); } getHourSlotWidth () {