This commit is contained in:
7
js/controllers/controls.js
vendored
7
js/controllers/controls.js
vendored
@ -188,6 +188,13 @@ export default class Controls {
|
||||
}
|
||||
}
|
||||
|
||||
destroy() {
|
||||
|
||||
this.unbind();
|
||||
this.element.remove();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Event handlers for navigation control buttons.
|
||||
*/
|
||||
|
@ -238,4 +238,17 @@ export default class Plugins {
|
||||
|
||||
}
|
||||
|
||||
destroy() {
|
||||
|
||||
Object.values( this.registeredPlugins ).forEach( plugin => {
|
||||
if( typeof plugin.destroy === 'function' ) {
|
||||
plugin.destroy();
|
||||
}
|
||||
} );
|
||||
|
||||
this.registeredPlugins = {};
|
||||
this.asyncDependencies = [];
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -75,6 +75,17 @@ export default class Pointer {
|
||||
|
||||
}
|
||||
|
||||
destroy() {
|
||||
|
||||
this.showCursor();
|
||||
|
||||
document.removeEventListener( 'DOMMouseScroll', this.onDocumentMouseScroll, false );
|
||||
document.removeEventListener( 'mousewheel', this.onDocumentMouseScroll, false );
|
||||
document.removeEventListener( 'mousemove', this.onDocumentCursorActive, false );
|
||||
document.removeEventListener( 'mousedown', this.onDocumentCursorActive, false );
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Called whenever there is mouse input at the document level
|
||||
* to determine if the cursor is active or not.
|
||||
|
Reference in New Issue
Block a user