diff --git a/src/app/helpers/jquery.module.js b/src/app/helpers/jquery.module.js index 2884f2a..ac0020e 100644 --- a/src/app/helpers/jquery.module.js +++ b/src/app/helpers/jquery.module.js @@ -114,6 +114,8 @@ define(function(require, exports) { self.data.set("visible", false); // remove all the slots from timetable $grid.find(".slot[id^=" + self.id + "-]").remove(); + // refresh timetable + $.publish("grid:refresh"); } else { // add slots to timetable $this.removeClass("icon-eye-close").addClass("icon-eye-open"); diff --git a/src/app/views/plannerView.js b/src/app/views/plannerView.js index b386c54..ef151ff 100644 --- a/src/app/views/plannerView.js +++ b/src/app/views/plannerView.js @@ -75,6 +75,15 @@ define(function(require, exports) { } }); + // refresh all days after some thing on timetable + $.subscribe("grid:refresh", function() { + var i, len = planner.weekDays.length; + + for (i = 0; i < len; i++) { + weekdays[planner.weekDays[i]].compressRows(); + } + }); + // allocate a single slot and its section slot $.subscribe("grid:module:allocate", function(e, slot, type, mod) { _allocateSlot(slot, type, mod);