A Handler
is used to trap specific user-gestures on a control
and inform all registered listeners.
For example, module:ct-element/handler/ClickHandler
is used to
trap the click event on a control and communicate it to all
module:ct-element/RendererEventListener
s.
All Handler
implementations are singletons.
Methods
finalise(renderer)
Allows the handler to perform tear-down on the renderer. This method is called after the renderer is unbound from the view.
Parameters:
Name | Type | Description |
---|---|---|
renderer |
module:ct-element |
The renderer that is being finalised. |
initialise(renderer, attributes)
Allows the handler to perform any initialisation code on the renderer. This method is called after the renderer is bound to the view for the first time. Implementing this method is optional.
Parameters:
Name | Type | Description |
---|---|---|
renderer |
module:ct-element |
The renderer that is being initialised |
attributes |
object | Any configuration parameters for this handler. |