Listens to the type of Event. type can be a String, or an Array of Strings.
The listener will be bound to the given node, defaults to document.documentElement.
The callback function of the Listener. This will be called if an Event happens the Listener listens to.
The listener will destroy itself after the first Event was received.
The listener will filter the Event's target with the given selector. This can be a CSS selector a Function.
If this is a CSS selector, the Event is only accepted, if any element matches the selector between the target of the event and the node this Listener is listening on.
If a Function is provided, the Function needs to return true or false, whether to accept the Event or not. The Function receives the Event's target as first parameter and the Listener's node as second parameter.
The element matched by the selector will be available using the method getCurrentTarget() of the CUI.Event.
The selector only works for native browser events.
This takes any object, it can be used to destroy the registered Listener, using Events.ignore.
If set to true, the Listener listens during the capture phase of the Event.
Returns true, if this Listener listens during the capture phase of the Event.
Returns true, if the only_once option is set.
Removes the Listener and stops listening.
Returns the node, this Listener is listening on.
Returns the types, this Listener is listening for. This returns an Array of Strings.
Returns the instance set at create time.
The filter is checked against the Listener. If filter is an instance of Listener, it returns true, if Listener is the same instance as filter.
If the filter is a PlainObject, the Object is matched against the Listeners options. instance, node, type, call, and node are supported. The node matches if it the same or below the filter.node.
Returns the distance of the Listener node to the Event node, if the provided event matches the Listener. This method is used internally and provide if need for debugging purposes.
Returns null, if the event does not match the Listener.
Returns the depth of the last match event. This method is used internally and provide if need for debugging purposes.
Handles the event during the given phase. This method is used internally and provide if need for debugging purposes.
Returns CUI.Listener, using the provided listener. If event is a PlainObject, a new CUI.Event is created, using event as the options.
If a CUI.Event is provided, that event is returned, no further action is performed.
debug_name is used to show inside the assert for identification if the CUI.Event could not be created.
The Listener function is retrieved from the Events registry.