fix for #1210 (Dinamically show ReferenceStrip) additional changes

This commit is contained in:
Robert Saric 2017-06-24 17:58:19 +02:00
parent a783edc76f
commit ec7e5e5419

View File

@ -504,10 +504,7 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype,
}
if (this.sequenceMode && $.isArray(tileSources)) {
if (this.referenceStrip) {
this.referenceStrip.destroy();
this.referenceStrip = null;
}
this.removeReferenceStrip();
if (typeof initialPage != 'undefined' && !isNaN(initialPage)) {
this.initialPage = initialPage;
@ -519,19 +516,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();
}
}
@ -2136,20 +2121,18 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype,
/**
* Remove the reference strip.
* @param {Boolean} hide - Disables automatic showing of the reference strip in the future until manually re-enabled.
* @function
* @return {OpenSeadragon.Viewer} Chainable.
*/
removeReferenceStrip: function() {
removeReferenceStrip: function(hide) {
if (hide) {
this.showReferenceStrip = false;
}
if (this.sequenceMode) {
if (this.referenceStrip) {
this.referenceStrip.destroy();
this.referenceStrip = null;
}
}
return this;
},
/**
@ -2162,8 +2145,7 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype,
if (this.sequenceMode) {
if (this.referenceStrip) {
this.referenceStrip.destroy();
this.referenceStrip = null;
return this;
}
if (this.tileSources.length && this.tileSources.length > 1) {