Ensure time slot and event grids have the same number of columns.

This commit is contained in:
Daru13 2018-11-24 03:14:18 +01:00
parent b2dabd1dc4
commit 41b640a1ea

View file

@ -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 () {