ReadonlydocumentA reference to the module:engine/view/document~ViewDocument object.
ReadonlyviewAn instance of the view controller.
The state of the observer. If it is disabled, no events will be fired.
Checks whether a given DOM event should be ignored (should not be turned into a synthetic view document event).
Currently, an event will be ignored only if its target or any of its ancestors has the data-cke-ignore-events attribute.
This attribute can be used inside the structures generated by
module:engine/view/downcastwriter~ViewDowncastWriter#createUIElement ViewDowncastWriter#createUIElement() to ignore events
fired within a UI that should be excluded from CKEditor 5's realms.
The DOM event target to check (usually an element, sometimes a text node and potentially sometimes a document, too).
Whether this event should be ignored by the observer.
Delegates selected events to another module:utils/emittermixin~Emitter. For instance:
emitterA.delegate( 'eventX' ).to( emitterB );
emitterA.delegate( 'eventX', 'eventY' ).to( emitterC );
then eventX is delegated (fired by) emitterB and emitterC along with data:
emitterA.fire( 'eventX', data );
and eventY is delegated (fired by) emitterC along with data:
emitterA.fire( 'eventY', data );
Event names that will be delegated to another emitter.
Disables and destroys the observer, among others removes event listeners created by the observer.
Enables the observer. This method is called when the observer is registered to the module:engine/view/view~EditingView and after module:engine/view/view~EditingView#forceRender rendering (all observers are #disable disabled before rendering).
A typical use case for disabling observers is that mutation observers need to be disabled for the rendering. However, a child class may not need to be disabled, so it can implement an empty method.
Fires an event, executing all callbacks registered for it.
The first parameter passed to callbacks is an module:utils/eventinfo~EventInfo object,
followed by the optional args provided in the fire() method call.
The type describing the event. See module:utils/emittermixin~BaseEvent.
The name of the event or EventInfo object if event is delegated.
Additional arguments to be passed to the callbacks.
By default the method returns undefined. However, the return value can be changed by listeners
through modification of the module:utils/eventinfo~EventInfo#return evt.return's property (the event info
is the first param of every callback).
Registers a callback function to be executed when an event is fired in a specific Emitter or DOM Node. It is backwards compatible with module:utils/emittermixin~Emitter#listenTo.
The object that fires the event.
The name of the event.
The function to be called on event.
Optionaloptions: CallbackOptions & { useCapture?: boolean; usePassive?: boolean }Additional options.
Optional ReadonlyuseCapture?: booleanIndicates that events of this type will be dispatched to the registered listener before being dispatched to any EventTarget beneath it in the DOM tree.
Optional ReadonlyusePassive?: booleanIndicates that the function specified by listener will never call preventDefault() and prevents blocking browser's main thread by this event handler.
Registers a callback function to be executed when an event is fired in a specific (emitter) object.
Events can be grouped in namespaces using :.
When namespaced event is fired, it additionally fires all callbacks for that namespace.
// myEmitter.on( ... ) is a shorthand for myEmitter.listenTo( myEmitter, ... ).
myEmitter.on( 'myGroup', genericCallback );
myEmitter.on( 'myGroup:myEvent', specificCallback );
// genericCallback is fired.
myEmitter.fire( 'myGroup' );
// both genericCallback and specificCallback are fired.
myEmitter.fire( 'myGroup:myEvent' );
// genericCallback is fired even though there are no callbacks for "foo".
myEmitter.fire( 'myGroup:foo' );
An event callback can module:utils/eventinfo~EventInfo#stop stop the event and set the module:utils/eventinfo~EventInfo#return return value of the #fire method.
The type describing the event. See module:utils/emittermixin~BaseEvent.
The object that fires the event.
The name of the event.
The function to be called on event.
Optionaloptions: CallbackOptionsAdditional options.
Starts observing given DOM element.
Stops executing the callback on the given event.
Shorthand for #stopListening this.stopListening( this, event, callback ).
The name of the event.
The function to stop being called.
Registers a callback function to be executed when an event is fired.
Shorthand for #listenTo this.listenTo( this, event, callback, options ) (it makes the emitter
listen on itself).
The type descibing the event. See module:utils/emittermixin~BaseEvent.
The name of the event.
The function to be called on event.
Optionaloptions: GetCallbackOptions<TEvent>Additional options.
Registers a callback function to be executed on the next time the event is fired only. This is similar to calling #on followed by #off in the callback.
The type descibing the event. See module:utils/emittermixin~BaseEvent.
The name of the event.
The function to be called on event.
Optionaloptions: GetCallbackOptions<TEvent>Additional options.
Stops delegating events. It can be used at different levels:
Optionalevent: stringThe name of the event to stop delegating. If omitted, stops it all delegations.
Optionalemitter: Emitter(requires event) The object to stop delegating a particular event to.
If omitted, stops delegation of event to all emitters.
Stops listening for events. It can be used at different levels: It is backwards compatible with module:utils/emittermixin~Emitter#listenTo.
Optionalemitter: Node | EventTarget | Emitter | WindowThe object to stop listening to. If omitted, stops it for all objects.
Optionalevent: string(Requires the emitter) The name of the event to stop listening to. If omitted, stops it
for all events from emitter.
Optionalcallback: Function(Requires the event) The function to be removed from the call list for the given
event.
Stops observing given DOM element.
Tab observer introduces the module:engine/view/document~ViewDocument#event:tab
Document#tabevent.Note that because module:engine/view/observer/tabobserver~TabObserver is attached by the module:engine/view/view~EditingView, this event is available by default.