CGSGEventManager Class
This class manages the association of handler for a particular event which can occurs on a particular object. After an handler is bound to an event, it can be fire thanks to this manager too.
Item Index
Methods
_getHandlerPropertyName
-
eventName
Returns the name of a property to create on an object to store additional handlers.
Parameters:
-
eventName
ObjectString the event name
Returns:
the attribute name
bindHandler
-
observable
-
eventName
-
handler
Binds an handler function for an event which can occurs on a given observable object.
Parameters:
Returns:
the ID of the binding
dispatch
-
observable
-
eventName
-
event
Notifies an event to all handlers bound to the given event on the given observable object. For performance reasons, this method must not be called if no handler is bound to the observable. Consequently, for instance, if you have an event 'onClick' that you want to dispatch, wrap the call in an if statement like this (otherwise the execution will fail) : if (this.onClick) { CGSG.eventManager.dispatch(...); }
replaceHandler
-
key
-
handler
Replaces the handler associated to the given key by the new specified handler.
Parameters:
-
key
CGSGBindEntrythe key
-
handler
Functionthe new handler
unbindAll
-
observable
-
eventName
Unbinds all handlers registered for an event on a given object.