mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-29 08:36:10 +03:00
Exit early if an array is provided as a tile source.
This commit is contained in:
parent
954cbbdc46
commit
7c62974e57
@ -1286,19 +1286,21 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($.isArray(options.tileSource)) {
|
||||||
|
setTimeout(function() {
|
||||||
|
raiseAddItemFailed({
|
||||||
|
message: "[Viewer.addTiledImage] Sequences can not be added; add them one at a time instead.",
|
||||||
|
source: options.tileSource,
|
||||||
|
options: options
|
||||||
|
});
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this._loadQueue.push(myQueueItem);
|
this._loadQueue.push(myQueueItem);
|
||||||
|
|
||||||
getTileSourceImplementation( this, options.tileSource, function( tileSource ) {
|
getTileSourceImplementation( this, options.tileSource, function( tileSource ) {
|
||||||
|
|
||||||
if ( tileSource instanceof Array ) {
|
|
||||||
raiseAddItemFailed({
|
|
||||||
message: "[Viewer.addTiledImage] Sequences can not be added; add them one at a time instead.",
|
|
||||||
source: tileSource,
|
|
||||||
options: options
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
myQueueItem.tileSource = tileSource;
|
myQueueItem.tileSource = tileSource;
|
||||||
|
|
||||||
// add everybody at the front of the queue that's ready to go
|
// add everybody at the front of the queue that's ready to go
|
||||||
@ -2101,8 +2103,6 @@ function getTileSourceImplementation( viewer, tileSource, successCallback,
|
|||||||
var options = $TileSource.prototype.configure.apply( _this, [ tileSource ] );
|
var options = $TileSource.prototype.configure.apply( _this, [ tileSource ] );
|
||||||
waitUntilReady(new $TileSource(options), tileSource);
|
waitUntilReady(new $TileSource(options), tileSource);
|
||||||
}
|
}
|
||||||
} else if ($.isArray(tileSource)) {
|
|
||||||
successCallback(tileSource);
|
|
||||||
} else {
|
} else {
|
||||||
//can assume it's already a tile source implementation
|
//can assume it's already a tile source implementation
|
||||||
waitUntilReady(tileSource, tileSource);
|
waitUntilReady(tileSource, tileSource);
|
||||||
|
Loading…
Reference in New Issue
Block a user