mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-22 05:06:09 +03:00
Merge pull request #1175 from VipSaran/master
fix for #1172 (ReferenceStrip not freeing resources)
This commit is contained in:
commit
6ae0ad887c
@ -178,6 +178,7 @@ $.ReferenceStrip = function ( options ) {
|
|||||||
this.panelWidth = ( viewerSize.x * this.sizeRatio ) + 8;
|
this.panelWidth = ( viewerSize.x * this.sizeRatio ) + 8;
|
||||||
this.panelHeight = ( viewerSize.y * this.sizeRatio ) + 8;
|
this.panelHeight = ( viewerSize.y * this.sizeRatio ) + 8;
|
||||||
this.panels = [];
|
this.panels = [];
|
||||||
|
this.miniViewers = {};
|
||||||
|
|
||||||
/*jshint loopfunc:true*/
|
/*jshint loopfunc:true*/
|
||||||
for ( i = 0; i < viewer.tileSources.length; i++ ) {
|
for ( i = 0; i < viewer.tileSources.length; i++ ) {
|
||||||
@ -293,6 +294,12 @@ $.extend( $.ReferenceStrip.prototype, $.EventSource.prototype, $.Viewer.prototyp
|
|||||||
|
|
||||||
// Overrides Viewer.destroy
|
// Overrides Viewer.destroy
|
||||||
destroy: function() {
|
destroy: function() {
|
||||||
|
if (this.miniViewers) {
|
||||||
|
for (var key in this.miniViewers) {
|
||||||
|
this.miniViewers[key].destroy();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (this.element) {
|
if (this.element) {
|
||||||
this.element.parentNode.removeChild(this.element);
|
this.element.parentNode.removeChild(this.element);
|
||||||
}
|
}
|
||||||
@ -463,6 +470,8 @@ function loadPanels( strip, viewerSize, scroll ) {
|
|||||||
miniViewer.displayRegion
|
miniViewer.displayRegion
|
||||||
);
|
);
|
||||||
|
|
||||||
|
strip.miniViewers[element.id] = miniViewer;
|
||||||
|
|
||||||
element.activePanel = true;
|
element.activePanel = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user