From 55cbaa625e90f150f3b5120e7128c9dc12a2c149 Mon Sep 17 00:00:00 2001 From: danzel Date: Wed, 29 Jan 2014 10:50:01 +1300 Subject: [PATCH] Fire animationend event even in non-animated versions of the zoom in/out animation. Makes oldie fire the same events as modern browsers. Fixes #310 --- src/MarkerClusterGroup.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/MarkerClusterGroup.js b/src/MarkerClusterGroup.js index 7c0d95608..cc7de903e 100644 --- a/src/MarkerClusterGroup.js +++ b/src/MarkerClusterGroup.js @@ -898,10 +898,16 @@ L.MarkerClusterGroup.include(!L.DomUtil.TRANSITION ? { _animationZoomIn: function (previousZoomLevel, newZoomLevel) { this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, previousZoomLevel); this._topClusterLevel._recursivelyAddChildrenToMap(null, newZoomLevel, this._getExpandedVisibleBounds()); + + //We didn't actually animate, but we use this event to mean "clustering animations have finished" + this.fire('animationend'); }, _animationZoomOut: function (previousZoomLevel, newZoomLevel) { this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, previousZoomLevel); this._topClusterLevel._recursivelyAddChildrenToMap(null, newZoomLevel, this._getExpandedVisibleBounds()); + + //We didn't actually animate, but we use this event to mean "clustering animations have finished" + this.fire('animationend'); }, _animationAddLayer: function (layer, newCluster) { this._animationAddLayerNonAnimated(layer, newCluster);