mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-29 00:26:10 +03:00
Better handle destruction when navigator in custom location
This commit is contained in:
parent
4ab8cc7481
commit
8178687298
@ -399,14 +399,22 @@ $.extend( $.Button.prototype, $.EventSource.prototype, /** @lends OpenSeadragon.
|
|||||||
},
|
},
|
||||||
|
|
||||||
destroy: function() {
|
destroy: function() {
|
||||||
|
if (this.imgRest) {
|
||||||
this.element.removeChild(this.imgRest);
|
this.element.removeChild(this.imgRest);
|
||||||
this.imgRest = null;
|
this.imgRest = null;
|
||||||
|
}
|
||||||
|
if (this.imgGroup) {
|
||||||
this.element.removeChild(this.imgGroup);
|
this.element.removeChild(this.imgGroup);
|
||||||
this.imgGroup = null;
|
this.imgGroup = null;
|
||||||
|
}
|
||||||
|
if (this.imgHover) {
|
||||||
this.element.removeChild(this.imgHover);
|
this.element.removeChild(this.imgHover);
|
||||||
this.imgHover = null;
|
this.imgHover = null;
|
||||||
|
}
|
||||||
|
if (this.imgDown) {
|
||||||
this.element.removeChild(this.imgDown);
|
this.element.removeChild(this.imgDown);
|
||||||
this.imgDown = null;
|
this.imgDown = null;
|
||||||
|
}
|
||||||
this.removeAllHandlers();
|
this.removeAllHandlers();
|
||||||
this.tracker.destroy();
|
this.tracker.destroy();
|
||||||
this.element = null;
|
this.element = null;
|
||||||
|
@ -161,7 +161,9 @@ $.Control.prototype = {
|
|||||||
*/
|
*/
|
||||||
destroy: function() {
|
destroy: function() {
|
||||||
this.wrapper.removeChild( this.element );
|
this.wrapper.removeChild( this.element );
|
||||||
|
if (this.anchor !== $.ControlAnchor.NONE) {
|
||||||
this.container.removeChild(this.wrapper);
|
this.container.removeChild(this.wrapper);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -775,7 +775,13 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype,
|
|||||||
this.removeAllHandlers();
|
this.removeAllHandlers();
|
||||||
|
|
||||||
if (this.buttons) {
|
if (this.buttons) {
|
||||||
|
if (this.buttons instanceof $.ButtonGroup) {
|
||||||
this.buttons.destroy();
|
this.buttons.destroy();
|
||||||
|
} else {
|
||||||
|
while (this.buttons.length) {
|
||||||
|
this.buttons.pop().destroy();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.paging) {
|
if (this.paging) {
|
||||||
@ -1869,6 +1875,8 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype,
|
|||||||
{anchor: this.navigationControlAnchor || $.ControlAnchor.TOP_LEFT}
|
{anchor: this.navigationControlAnchor || $.ControlAnchor.TOP_LEFT}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
this.buttons = buttons;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user