mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-25 06:36:11 +03:00
Fixed problem with missing .length in for loop of raiseAddItemFailed event.
Added viewer._cancelPendingImages method that clears the loadQueue. Added call to _cancelPendingImages from within the world.removeAll method.
This commit is contained in:
parent
13d7e697f6
commit
c4aa3715a7
@ -1243,7 +1243,7 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype,
|
|||||||
};
|
};
|
||||||
|
|
||||||
function raiseAddItemFailed( event ) {
|
function raiseAddItemFailed( event ) {
|
||||||
for (var i = 0; i < _this._loadQueue; i++) {
|
for (var i = 0; i < _this._loadQueue.length; i++) {
|
||||||
if (_this._loadQueue[i] === myQueueItem) {
|
if (_this._loadQueue[i] === myQueueItem) {
|
||||||
_this._loadQueue.splice(i, 1);
|
_this._loadQueue.splice(i, 1);
|
||||||
break;
|
break;
|
||||||
@ -1982,6 +1982,13 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype,
|
|||||||
for ( i = 0; i < length; i++ ) {
|
for ( i = 0; i < length; i++ ) {
|
||||||
this.currentOverlays[ i ].drawHTML( this.overlaysContainer, this.viewport );
|
this.currentOverlays[ i ].drawHTML( this.overlaysContainer, this.viewport );
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Cancel the "in flight" images.
|
||||||
|
*/
|
||||||
|
_cancelPendingImages: function() {
|
||||||
|
this._loadQueue = [];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -202,6 +202,8 @@ $.extend( $.World.prototype, $.EventSource.prototype, /** @lends OpenSeadragon.W
|
|||||||
* @fires OpenSeadragon.World.event:metrics-change
|
* @fires OpenSeadragon.World.event:metrics-change
|
||||||
*/
|
*/
|
||||||
removeAll: function() {
|
removeAll: function() {
|
||||||
|
// We need to make sure any pending images are canceled so the world items don't get messed up
|
||||||
|
this.viewer._cancelPendingImages();
|
||||||
var item;
|
var item;
|
||||||
for (var i = 0; i < this._items.length; i++) {
|
for (var i = 0; i < this._items.length; i++) {
|
||||||
item = this._items[i];
|
item = this._items[i];
|
||||||
|
Loading…
Reference in New Issue
Block a user