Methods
add(handler, argsopt, fireOnceopt) → {String}
Adds an event handler for the event.
Parameters:
| Name |
Type |
Attributes |
Description |
handler |
function
|
|
Callback method to invoke when the event fires. Event can be cancelled by returning false. |
args |
Array.<Object>
|
<optional>
|
Arguments to pass to the specified event handler when the event fires. |
fireOnce |
Boolean
|
<optional>
|
A value indicating if the handler will fire only once which means that the handler is removed from the event directly after execution. |
Returns:
The unique id of the event-handler.
-
Type
-
String
disable(priorityHandleropt)
Disables the event until the current call stack is finished by using a setTimeout() call.
Parameters:
| Name |
Type |
Attributes |
Default |
Description |
priorityHandler |
boolean
|
<optional>
|
false
|
Indicates whether to disable the priority handler instead of the main handler.
This should generally remain false when called by client code directly. Only set to true internally within a component to disable the prioritized handler. |
enable(priorityHandleropt)
Re-enables disabled events directly.
Parameters:
| Name |
Type |
Attributes |
Default |
Description |
priorityHandler |
boolean
|
<optional>
|
false
|
Indicates whether to enable the disabled priority handler instead of the main handler.
This should generally remain false when called by client code directly. Only set to true internally within a component to disable the prioritized handler. |
fire(context, arguments)
Fires the event. This method should not be invoked by client code directly but only from inside component code.
Parameters:
| Name |
Type |
Description |
context |
Object
|
The context (this) for which the method is invoked. |
arguments |
Array.<Object>
|
A list of arguments to pass to the event handlers. |
(protected) handlers() → {Object}
Gets all bound event handlers.
Returns:
A list of bound handlers.
-
Type
-
Object
has(handler) → {Boolean}
Checks if the event handler is attached.
Parameters:
| Name |
Type |
Description |
handler |
function
|
The event handler to check. |
Returns:
A value indicating if the handler is already present on the event.
-
Type
-
Boolean
(protected) isBound() → {Boolean}
Checks if a handler is bound.
Returns:
A value indicating if a handler is bound to the event.
-
Type
-
Boolean
once(handler, argsopt) → {String}
Adds a fire once event handler for the event.
Parameters:
| Name |
Type |
Attributes |
Description |
handler |
function
|
|
Callback method to invoke when the event fires. Event can be cancelled by returning false. |
args |
Array.<Object>
|
<optional>
|
Arguments to pass to the specified event handler when the event fires. |
Returns:
The unique id of the event-handler.
-
Type
-
String
(protected) priorityAdd(handler, argsopt, fireOnceopt)
Adds an event handler with priority. This method should not be invoked by client code directly but only from inside component code. Priority handlers should only be used within a framework where the internal handler should be called before anything else.
Parameters:
| Name |
Type |
Attributes |
Description |
handler |
function
|
|
Callback method to invoke when the event fires. |
args |
Array.<Object>
|
<optional>
|
Arguments to pass to the specified event handler when the event fires. |
fireOnce |
Boolean
|
<optional>
|
A value indicating if the handler will fire only once which means that the handler is removed from the event directly after execution. |
(protected) priorityHandlers() → {Object}
Gets all bound priority event handlers.
Returns:
A list of bound handlers.
-
Type
-
Object
(protected) priorityRemove(eventPriorityopt)
Removes all event handlers for the event. This method should not be invoked by client code directly but only from inside component code.
Parameters:
| Name |
Type |
Attributes |
Description |
eventPriority |
Number
|
<optional>
|
The priority of the events to remove, null/0 for both normal and priority events, 1 for normal events only, 2 for priority events only. |
remove(handler)
Removes an event handler for the event.
Parameters:
| Name |
Type |
Description |
handler |
function
|
Callback method to invoke when the event fires. |
removeAll()
Removes all event handlers for the event.