utils/dom/emittermixin
@ckeditor/ckeditor5-utils/src/dom/emittermixin
Filtering
Classes
-
ProxyEmitter
private
Creates a ProxyEmitter instance. Such an instance is a bridge between a DOM Node firing events and any Host listening to them. It is backwards compatible with
on
.
Interfaces
-
Interface representing classes which mix in
EmitterMixin
.
Functions
-
_getProxyEmitter( node ) → ProxyEmitter
Retrieves ProxyEmitter instance for given DOM Node residing in this Host.
Parameters
node : Node
DOM Node of the ProxyEmitter.
Returns
ProxyEmitter
ProxyEmitter instance or null.
-
listenTo( emitter, event, callback, [ options ] = { [options.priority], [options.useCapture] } )
Registers a callback function to be executed when an event is fired in a specific Emitter or DOM Node. It is backwards compatible with
listenTo
.Parameters
emitter : Emitter | Node
The object that fires the event.
event : String
The name of the event.
callback : function
The function to be called on event.
[ options ] : Object
Additional options.
Properties[ options.priority ] : PriorityString | Number
The priority of this event callback. The higher the priority value the sooner the callback will be fired. Events having the same priority are called in the order they were added.
Defaults to
'normal'
[ options.useCapture ] : Boolean
Indicates that events of this type will be dispatched to the registered listener before being dispatched to any EventTarget beneath it in the DOM tree.
Defaults to
false
Defaults to
{}
-
stopListening( [ emitter ], [ event ], [ callback ] )
Stops listening for events. It can be used at different levels: It is backwards compatible with
listenTo
.- To stop listening to a specific callback.
- To stop listening to a specific event.
- To stop listening to all events fired by a specific object.
- To stop listening to all events fired by all object.
Parameters
[ emitter ] : Emitter | Node
The object to stop listening to. If omitted, stops it for all objects.
[ event ] : String
(Requires the
emitter
) The name of the event to stop listening to. If omitted, stops it for all events fromemitter
.[ callback ] : function
(Requires the
event
) The function to be removed from the call list for the givenevent
.