Use the last child of the container only if loading was aborted

Otherwise we may pick a tile that is already half way through the
transition, which will cause the backbuffer to go away too early.
This commit is contained in:
ahocevar
2013-03-26 14:48:23 +01:00
parent 7f18a7b3df
commit 316c1888d2

View File

@@ -1116,7 +1116,8 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
this.removeBackBuffer();
} else {
// wait until transition has ended or delay has passed
this._transitionElement = this.div.lastChild;
this._transitionElement = aborted ?
this.div.lastChild : tile.imgDiv;
var transitionendEvents = this.transitionendEvents;
for (var i=transitionendEvents.length-1; i>=0; --i) {
OpenLayers.Event.observe(this._transitionElement,