A wrapper around removeEventListener that adds some parameter checking.
Parameter | Type | Description |
---|---|---|
target | String | Target to observe |
type | String | Type of event being observed |
handlerFunction | Function | Function previously passed to listen |
useCapture | Boolean | True causes a capture phase listener to be removed. Optional. |
Example usage:
StartpageAssistant.prototype.deactivate = function() { // Stop listening for taps on the start page icons Mojo.Event.stopListening(this.controller.get('bookmarks'), Mojo.Event.tap, this._onStartPageTapHandler, true); // Cleanup focus handlers. this.controller.document.removeEventListener(Mojo.Event.activate, this._onCardActivateHandler, false); this.controller.document.removeEventListener(Mojo.Event.deactivate, this._onCardDeactivateHandler, false); this._isActivated = false; this._addressBar.stopObserving(); this._addressBar.closeSearchResults(); };
0 Comments