Namespace GSEventManager
GSEventManager provides an interface for managing the registration of event handlers
for DOM objects.
| Constructor Attributes | Constructor Name and Description |
|---|---|
GSEventManager should not be instantiated, all of its methods are called
statically. |
| Method Attributes | Method Name and Description |
|---|---|
| <static> |
GSEventManager.addEventListener(obj, eventType, func, scope)
Registers the given function
func as a handler for events of the specified
type occurring on the source object, obj. |
| <static> |
GSEventManager.bind(subject, eventType, observer, method)
Binds an event on the subject to a method of the observing class.
|
| <static> |
GSEventManager.release(token)
Removes the binding of the subject event to a method on it's observer.
|
| <static> |
GSEventManager.removeEventListener(token)
Removes the given function
func as a handler for the events of the
specified type on the source object. |
Namespace Detail
GSEventManager
GSEventManager should not be instantiated, all of its methods are called
statically.
Method Detail
<static>
{Object}
GSEventManager.addEventListener(obj, eventType, func, scope)
Registers the given function
func as a handler for events of the specified
type occurring on the source object, obj. This method encapsulates the
appropriate browser-specific calls to register the handler. This function returns a token
that can be passed to the GSEventManager#removeEventListener to remove the event
listener.
- Parameters:
- {Object} obj
- the object to add the listener to
- {String} eventType
- the event type to add the listener for. Can be one of:
click, mousedown, mouseup, mouseover, mouseout - {Function} func
- The function to invoke when the event is triggered
- {Object} scope Optional
- the scope (
thisreference) in which the function is executed
- Returns:
- {Object} a token that can be passed to the GSEventManager#removeEventListener to remove the event listener.
<static>
{Object}
GSEventManager.bind(subject, eventType, observer, method)
Binds an event on the subject to a method of the observing class. Returns a token
that can be passed to the GSEventManager#release method to remove the binding.
- Parameters:
- {Object} subject
- the object whose state is being observed
- {String} eventType
- the type of event which the observing object is subscribing to
- {Object} observer
- the object that is listening for events of a specific type occurring on the subject
- {Function} method
- the method of the observer that should be bound to the target method of the subject
- Deprecated:
-
since version 3.0. use GSEventManager#addEventListener with the
scopeparameter instead
- Returns:
- {Object} a token identifying the binding to be passed to the GSEventManager#release method
<static>
GSEventManager.release(token)
Removes the binding of the subject event to a method on it's observer.
- Parameters:
- {Object} token
- a token identifying the binding to release
<static>
GSEventManager.removeEventListener(token)
Removes the given function
func as a handler for the events of the
specified type on the source object. This method encapsulates the
appropritate browser-specific calls to de-register the handler.
- Parameters:
- {Object} token
- a token identifying the registered event handler to remove