Contains methods that provide event capabilities to an object which is passed to evented.
- Source
Methods
(static) any(targetOrType, typeOrListener, listeneropt)
Add a listener to an event (or events) on this object or another evented object. The listener will only be called once for the first event that is triggered then removed.
Name | Type | Attributes | Description |
---|---|---|---|
targetOrType | string | | If this is a string or array, it represents the event type(s) that will trigger the listener.
| |
typeOrListener | string | | If the first argument was a string or array, this should be the listener function. Otherwise, this is a string or array of event type(s). | |
listener | function | <optional> | If the first argument was another evented object, this will be the listener function. |
- Source
(static) off(targetOrTypeopt, typeOrListeneropt, listeneropt)
Removes listener(s) from event(s) on an evented object.
Name | Type | Attributes | Description |
---|---|---|---|
targetOrType | string | | <optional> | If this is a string or array, it represents the event type(s).
|
typeOrListener | string | | <optional> | If the first argument was a string or array, this may be the listener function. Otherwise, this is a string or array of event type(s). |
listener | function | <optional> | If the first argument was another evented object, this will be the listener function; otherwise, all listeners bound to the event type(s) will be removed. |
- Source
(static) on(targetOrType, typeOrListener, listeneropt)
Add a listener to an event (or events) on this object or another evented object.
Name | Type | Attributes | Description |
---|---|---|---|
targetOrType | string | | If this is a string or array, it represents the event type(s) that will trigger the listener.
| |
typeOrListener | string | | If the first argument was a string or array, this should be the listener function. Otherwise, this is a string or array of event type(s). | |
listener | function | <optional> | If the first argument was another evented object, this will be the listener function. |
- Source
(static) one(targetOrType, typeOrListener, listeneropt)
Add a listener to an event (or events) on this object or another evented object. The listener will be called once per event and then removed.
Name | Type | Attributes | Description |
---|---|---|---|
targetOrType | string | | If this is a string or array, it represents the event type(s) that will trigger the listener.
| |
typeOrListener | string | | If the first argument was a string or array, this should be the listener function. Otherwise, this is a string or array of event type(s). | |
listener | function | <optional> | If the first argument was another evented object, this will be the listener function. |
- Source
(static) trigger(event, hashopt) → {boolean}
Fire an event on this evented object, causing its listeners to be called.
Name | Type | Attributes | Description |
---|---|---|---|
event | string | | An event type or an object with a type property. | |
hash | Object | <optional> | An additional object to pass along to listeners. |
- Source
Whether or not the default behavior was prevented.
- Type:
- boolean