Skip to content

Commit

Permalink
Merge pull request openlayers#843 from ahocevar/early-loadend
Browse files Browse the repository at this point in the history
Safeguard against listeners that recreate the grid. r=@bartvde
  • Loading branch information
ahocevar committed Jan 17, 2013
2 parents 0f9010c + c742c14 commit 32d7e02
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/OpenLayers/Layer/Grid.js
Expand Up @@ -1104,8 +1104,6 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
}
//if that was the last tile, then trigger a 'loadend' on the layer
if (this.numLoadingTiles === 0) {
this.loading = false;
this.events.triggerEvent("loadend");
if(this.backBuffer) {
this._transitionElement = tile.imgDiv;
for (var i=this.transitionendEvents.length-1; i>=0; --i) {
Expand All @@ -1119,6 +1117,8 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
this._removeBackBuffer, this.removeBackBufferDelay
);
}
this.loading = false;
this.events.triggerEvent("loadend");
}
};

Expand Down

0 comments on commit 32d7e02

Please sign in to comment.