mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-22 05:06:09 +03:00
Merge pull request #1213 from VipSaran/master
fix for #1210 (Dinamically show ReferenceStrip)
This commit is contained in:
commit
818d445ec9
@ -519,19 +519,7 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype,
|
||||
this.open(this.tileSources[this._sequenceIndex]);
|
||||
|
||||
if ( this.showReferenceStrip ){
|
||||
this.referenceStrip = new $.ReferenceStrip({
|
||||
id: this.referenceStripElement,
|
||||
position: this.referenceStripPosition,
|
||||
sizeRatio: this.referenceStripSizeRatio,
|
||||
scroll: this.referenceStripScroll,
|
||||
height: this.referenceStripHeight,
|
||||
width: this.referenceStripWidth,
|
||||
tileSources: this.tileSources,
|
||||
prefixUrl: this.prefixUrl,
|
||||
viewer: this
|
||||
});
|
||||
|
||||
this.referenceStrip.setFocus( this._sequenceIndex );
|
||||
this.addReferenceStrip();
|
||||
}
|
||||
}
|
||||
|
||||
@ -2155,6 +2143,51 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype,
|
||||
*/
|
||||
_cancelPendingImages: function() {
|
||||
this._loadQueue = [];
|
||||
},
|
||||
|
||||
/**
|
||||
* Removes the reference strip and disables displaying it.
|
||||
* @function
|
||||
*/
|
||||
removeReferenceStrip: function() {
|
||||
this.showReferenceStrip = false;
|
||||
|
||||
if (this.referenceStrip) {
|
||||
this.referenceStrip.destroy();
|
||||
this.referenceStrip = null;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Enables and displays the reference strip based on the currently set tileSources.
|
||||
* @function
|
||||
*/
|
||||
addReferenceStrip: function() {
|
||||
this.showReferenceStrip = true;
|
||||
|
||||
if (this.sequenceMode) {
|
||||
if (this.referenceStrip) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.tileSources.length && this.tileSources.length > 1) {
|
||||
this.referenceStrip = new $.ReferenceStrip({
|
||||
id: this.referenceStripElement,
|
||||
position: this.referenceStripPosition,
|
||||
sizeRatio: this.referenceStripSizeRatio,
|
||||
scroll: this.referenceStripScroll,
|
||||
height: this.referenceStripHeight,
|
||||
width: this.referenceStripWidth,
|
||||
tileSources: this.tileSources,
|
||||
prefixUrl: this.prefixUrl,
|
||||
viewer: this
|
||||
});
|
||||
|
||||
this.referenceStrip.setFocus( this._sequenceIndex );
|
||||
}
|
||||
} else {
|
||||
$.console.warn('Attempting to display a reference strip while "sequenceMode" is off.');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user