SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A class used to register, trigger and remove events on both DOM and Javascript objects. Uses the singleton design pattern. To enforce one single instance we use an anonymous constructor.
Author: BANConstructor Summary | |
IWEventManager()
|
Method Summary | |
IWEventListener
|
addDomListener(obj, eventName, eventHandler)
Registers a handler for the DOM event eventName for the given object.
If possible the W3C or Microsoft syntax for attaching events will be used, otherwise an IW event handler is
registered.
|
IWEventListener
|
addListener(obj, eventName, eventHandler)
Registers a handler for the event "event" for the given object. |
IWEventListener
|
bind(obj, eventName, listenerObj, eventHandler)
Registers a method from an object as handler for events of the specified type from another object. |
void
|
clearInstanceListeners(obj)
Removes all registered handlers for the given object. |
void
|
clearListeners(obj, eventName)
Removes all handlers for the specified event type and object. |
void
|
removeListener(eventListener)
Removes the handler determined by the specified reference. |
void
|
trigger(obj, eventName, theEvent)
Triggers the event on the given object. |
Constructor Detail |
IWEventManager()
Method Detail |
IWEventListener addDomListener(obj, eventName, eventHandler)
eventName
for the given object.
If possible the W3C or Microsoft syntax for attaching events will be used, otherwise an IW event handler is
registered.
Object obj
- the object firing the event
String eventName
- the name of the event
Function eventHandler
- the listener function to register
IWEventListener
the listener object which can be used to remove the handler
IWEventListener addListener(obj, eventName, eventHandler)
Object obj
- the object firing the event
String eventName
- the name of the event
Function eventHandler
- the listener function to register
IWEventListener
the listener object which can be used to remove the handler
IWEventListener bind(obj, eventName, listenerObj, eventHandler)
Object obj
- the object firing the event
String eventName
- the name of the event
Object listenerObj
- the object listening to the event
Function eventHandler
- the listener function to register
IWEventListener
void clearInstanceListeners(obj)
Object obj
void
void clearListeners(obj, eventName)
Object obj
- an object with registered events
String eventName
- the name of the event to unregister
void
void removeListener(eventListener)
IWEventListener eventListener
- the event listener to remove
void
void trigger(obj, eventName, theEvent)
Object obj
- the object triggering this event
String eventName
- the name of this event
Object theEvent
- the event object
void