mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-22 13:16:10 +03:00
Flip the order in which view and navigator add a new item
This change ensures that the added items are updated first in the navigator's world. If the viewer's world is updated first, it fires an add-item event, which in turn it may encounter a setItemIndex call; since the navigator's world does not have the item yet, an error occurs.
This commit is contained in:
parent
577622a210
commit
932b826c4d
@ -1502,6 +1502,17 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype,
|
||||
if (_this.collectionMode) {
|
||||
_this.world.setAutoRefigureSizes(false);
|
||||
}
|
||||
|
||||
if (_this.navigator) {
|
||||
optionsClone = $.extend({}, queueItem.options, {
|
||||
replace: false, // navigator already removed the layer, nothing to replace
|
||||
originalTiledImage: tiledImage,
|
||||
tileSource: queueItem.tileSource
|
||||
});
|
||||
|
||||
_this.navigator.addTiledImage(optionsClone);
|
||||
}
|
||||
|
||||
_this.world.addItem( tiledImage, {
|
||||
index: queueItem.options.index
|
||||
});
|
||||
@ -1515,16 +1526,6 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype,
|
||||
_this.viewport.goHome(true);
|
||||
}
|
||||
|
||||
if (_this.navigator) {
|
||||
optionsClone = $.extend({}, queueItem.options, {
|
||||
replace: false, // navigator already removed the layer, nothing to replace
|
||||
originalTiledImage: tiledImage,
|
||||
tileSource: queueItem.tileSource
|
||||
});
|
||||
|
||||
_this.navigator.addTiledImage(optionsClone);
|
||||
}
|
||||
|
||||
if (queueItem.options.success) {
|
||||
queueItem.options.success({
|
||||
item: tiledImage
|
||||
|
Loading…
Reference in New Issue
Block a user