jsPlumbUtil.EventGenerator Class
Provides event bind/fire functionality.
Item Index
Methods
bind
-
event -
listener -
[insertAtStart=false]
Binds a listener to an event.
Parameters:
-
eventStringName of the event to bind to.
-
listenerFunctionFunction to execute.
-
[insertAtStart=false]Boolean optionalWhether or not to insert this listener at the start of the listener list, so it is fired before the other currently registered listeners.
cleanupListeners
()
Removes all listeners.
fire
-
event -
value -
originalEvent
Fires an update for the given event.
Parameters:
-
eventStringEvent to fire
-
valueObjectValue to pass to the event listener(s).
-
originalEventEventThe original event from the browser
isSuspendEvents
()
Boolean
Checks whether or not events are currently suspended.
Returns:
True if events are suspended, false otherwise.
jsPlumbUtil.replace
-
inObj -
path -
value
Replaces values inside some JS object according to a given path spec. A path spec is a string in dotted notation, with each component optionally declaring an array index. Some examples are:
foo.bar foo.baz[2] foo.qux[3].baz[3].shwee
The function fails gracefully if the path identifies a non-existent object.
Parameters:
-
inObjObjectObject to perform replacements inside.
-
pathStringPath to use for replacements
-
valueObjectValue to set.
setSuspendEvents
-
val
Sets whether or not events are suspended.
Parameters:
-
valBooleanWhether or not to suspend events.
unbind
-
[event]
Clears either all listeners, or listeners for some specific event.
Parameters:
-
[event]String optionalConstrains the clear to just listeners for this event.
