mirror of
https://github.com/Hopiu/fabric.js.git
synced 2026-04-27 16:54:43 +00:00
Add fabric.util.stopObservingEvent. Needs tests.
This commit is contained in:
parent
03561f762f
commit
e7e19c2247
1 changed files with 13 additions and 0 deletions
|
|
@ -187,6 +187,18 @@
|
|||
customEventListeners[eventName].push(handler);
|
||||
}
|
||||
|
||||
/**
|
||||
* @mthod stopObservingEvent
|
||||
* @memberOf fabric.util
|
||||
* @param {String} eventName
|
||||
* @param {Function} handler
|
||||
*/
|
||||
function stopObservingEvent(eventName, handler) {
|
||||
if (customEventListeners[eventName]) {
|
||||
fabric.util.removeFromArray(customEventListeners[eventName], handler);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Fires event with an optional memo object
|
||||
* @mthod fireEvent
|
||||
|
|
@ -237,5 +249,6 @@
|
|||
|
||||
fabric.util.getPointer = getPointer;
|
||||
fabric.util.observeEvent = observeEvent;
|
||||
fabric.util.stopObservingEvent = stopObservingEvent;
|
||||
fabric.util.fireEvent = fireEvent;
|
||||
})(this);
|
||||
Loading…
Reference in a new issue