mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-25 06:36:11 +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() {
|
||||||
this.element.removeChild(this.imgRest);
|
if (this.imgRest) {
|
||||||
this.imgRest = null;
|
this.element.removeChild(this.imgRest);
|
||||||
this.element.removeChild(this.imgGroup);
|
this.imgRest = null;
|
||||||
this.imgGroup = null;
|
}
|
||||||
this.element.removeChild(this.imgHover);
|
if (this.imgGroup) {
|
||||||
this.imgHover = null;
|
this.element.removeChild(this.imgGroup);
|
||||||
this.element.removeChild(this.imgDown);
|
this.imgGroup = null;
|
||||||
this.imgDown = null;
|
}
|
||||||
|
if (this.imgHover) {
|
||||||
|
this.element.removeChild(this.imgHover);
|
||||||
|
this.imgHover = null;
|
||||||
|
}
|
||||||
|
if (this.imgDown) {
|
||||||
|
this.element.removeChild(this.imgDown);
|
||||||
|
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 );
|
||||||
this.container.removeChild( this.wrapper );
|
if (this.anchor !== $.ControlAnchor.NONE) {
|
||||||
|
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) {
|
||||||
this.buttons.destroy();
|
if (this.buttons instanceof $.ButtonGroup) {
|
||||||
|
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