Bubbling emitter is triggering events in the context of specified module:engine/view/element~ViewElement view element name,
predefined '$text', '$root', '$document' and '$capture' contexts, and context matchers provided as a function.
Before bubbling starts, listeners for '$capture' context are triggered. Then the bubbling starts from the deeper selection
position (by firing event on the '$text' context) and propagates the view document tree up to the '$root' and finally
the listeners at '$document' context are fired (this is the default context).
Examples:
// Listeners registered in the context of the view element names: this.listenTo( viewDocument, 'enter', ( evt, data ) => { // ... }, { context:'blockquote' } );
// Listeners registered in the context of the '$text' and '$root' nodes. this.listenTo( view.document, 'arrowKey', ( evt, data ) => { // ... }, { context:'$text', priority:'high' } );
Bubbling emitter for the view document.
Bubbling emitter is triggering events in the context of specified module:engine/view/element~ViewElement view element name, predefined
'$text','$root','$document'and'$capture'contexts, and context matchers provided as a function.Before bubbling starts, listeners for
'$capture'context are triggered. Then the bubbling starts from the deeper selection position (by firing event on the'$text'context) and propagates the view document tree up to the'$root'and finally the listeners at'$document'context are fired (this is the default context).Examples:
Example flow for selection in text:
Fired events on contexts:
'$capture''$text''p''blockquote''$root''$document'Example flow for selection on element (i.e., Widget):
Fired events on contexts:
'$capture''p''blockquote''$root''$document'There could be multiple listeners registered for the same context and at different priority levels:
'$capture'at priorities:'highest''high''normal''low''lowest''$text'at priorities:'highest''high''normal''low''lowest''p'at priorities:'highest''high''normal''low''lowest''$root'at priorities:'highest''high''normal''low''lowest''$document'at priorities:'highest''high''normal''low''lowest'