fix bug with eventDestroy not being called

This commit is contained in:
Adam Shaw
2014-08-23 16:24:12 -07:00
parent 5296dbde61
commit c64e483353
3 changed files with 4 additions and 5 deletions
+1 -2
View File
@@ -357,6 +357,7 @@ $.extend(AgendaView.prototype, {
// Unrenders all event elements and clears internal segment data
destroyEvents: function() {
View.prototype.destroyEvents.call(this); // do this before the grids' segs have been cleared
// if destroyEvents is being called as part of an event rerender, renderEvents will be called shortly
// after, so remember what the scroll value was so we can restore it.
@@ -371,8 +372,6 @@ $.extend(AgendaView.prototype, {
// we DON'T need to call updateHeight() because:
// A) a renderEvents() call always happens after this, which will eventually call updateHeight()
// B) in IE8, this causes a flash whenever events are rerendered
View.prototype.destroyEvents.call(this); // call the super-method
},
+2 -2
View File
@@ -250,14 +250,14 @@ $.extend(BasicView.prototype, {
// Unrenders all event elements and clears internal segment data
destroyEvents: function() {
View.prototype.destroyEvents.call(this); // do this before dayGrid's segs have been cleared
this.recordScroll(); // removing events will reduce height and mess with the scroll, so record beforehand
this.dayGrid.destroyEvents();
// we DON'T need to call updateHeight() because:
// A) a renderEvents() call always happens after this, which will eventually call updateHeight()
// B) in IE8, this causes a flash whenever events are rerendered
View.prototype.destroyEvents.call(this); // call the super-method
},
+1 -1
View File
@@ -175,7 +175,7 @@ View.prototype = {
// Removes event elements from the view.
// Should be overridden by subclasses. Actual element destruction should happen first, then call super-method.
// Should be overridden by subclasses. Should call this super-method FIRST, then subclass DOM destruction.
destroyEvents: function() {
this.segEach(function(seg) {
this.trigger('eventDestroy', seg.event, seg.event, seg.el);