mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-22 05:06:09 +03:00
Added event for viewer destroy
This commit is contained in:
parent
d7cd12679c
commit
29384cd5ff
@ -756,6 +756,7 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype,
|
|||||||
* viewer = null; //important
|
* viewer = null; //important
|
||||||
*
|
*
|
||||||
* @function
|
* @function
|
||||||
|
* @fires OpenSeadragon.Viewer.event:destroy
|
||||||
*/
|
*/
|
||||||
destroy: function( ) {
|
destroy: function( ) {
|
||||||
if ( !THIS[ this.hash ] ) {
|
if ( !THIS[ this.hash ] ) {
|
||||||
@ -795,7 +796,6 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype,
|
|||||||
this.navigator = null;
|
this.navigator = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.removeAllHandlers();
|
|
||||||
|
|
||||||
if (this.buttonGroup) {
|
if (this.buttonGroup) {
|
||||||
this.buttonGroup.destroy();
|
this.buttonGroup.destroy();
|
||||||
@ -841,6 +841,18 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype,
|
|||||||
|
|
||||||
// clear our reference to the main element - they will need to pass it in again, creating a new viewer
|
// clear our reference to the main element - they will need to pass it in again, creating a new viewer
|
||||||
this.element = null;
|
this.element = null;
|
||||||
|
/**
|
||||||
|
* Raised when the viewer is destroyed (see {@link OpenSeadragon.Viewer#destroy}).
|
||||||
|
*
|
||||||
|
* @event destroy
|
||||||
|
* @memberof OpenSeadragon.Viewer
|
||||||
|
* @type {object}
|
||||||
|
* @property {OpenSeadragon.Viewer} eventSource - A reference to the Viewer which raised the event.
|
||||||
|
* @property {?Object} userData - Arbitrary subscriber-defined object.
|
||||||
|
*/
|
||||||
|
this.raiseEvent( 'destroy' );
|
||||||
|
|
||||||
|
this.removeAllHandlers();
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user