Skip to content
This repository has been archived by the owner on Dec 15, 2018. It is now read-only.

Commit

Permalink
refresh timetable on hide/show module
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuochun committed Aug 2, 2013
1 parent 1dc7cd5 commit feeb889
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/app/helpers/jquery.module.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
9 changes: 9 additions & 0 deletions src/app/views/plannerView.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit feeb889

Please sign in to comment.