mirror of
https://github.com/wassname/fullcalendar.git
synced 2026-08-03 12:50:21 +08:00
fix bug with eventDestroy not being called
This commit is contained in:
@@ -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
|
||||
},
|
||||
|
||||
|
||||
|
||||
@@ -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
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user