Make Cursor.detach() safe to call when not attached

Avoids having checks in higher layers.
pull/36/head
Pierre Ossman 6 years ago committed by Lauri Kasanen
parent a850be4afa
commit 12cdad066e

@ -64,6 +64,10 @@ export default class Cursor {
} }
detach() { detach() {
if (!this._target) {
return;
}
if (useFallback) { if (useFallback) {
const options = { capture: true, passive: true }; const options = { capture: true, passive: true };
this._target.removeEventListener('mouseover', this._eventHandlers.mouseover, options); this._target.removeEventListener('mouseover', this._eventHandlers.mouseover, options);

Loading…
Cancel
Save