diff --git a/src/agenda/AgendaView.js b/src/agenda/AgendaView.js index f30a573..708700c 100644 --- a/src/agenda/AgendaView.js +++ b/src/agenda/AgendaView.js @@ -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 }, diff --git a/src/basic/BasicView.js b/src/basic/BasicView.js index 3740deb..dd7c1a7 100644 --- a/src/basic/BasicView.js +++ b/src/basic/BasicView.js @@ -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 }, diff --git a/src/common/View.js b/src/common/View.js index 048a615..c3c1921 100644 --- a/src/common/View.js +++ b/src/common/View.js @@ -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);