Creates an editing controller instance.
Editing model.
The styles processor instance.
ReadonlydowncastDowncast dispatcher that converts changes from the model to the #view editing view.
ReadonlymapperA mapper that describes the model-view binding.
ReadonlymodelEditor model.
ReadonlyviewEditing view controller.
Removes all event listeners attached to the EditingController. Destroys all objects created
by EditingController that need to be destroyed.
Calling this method will downcast a model item on demand (by requesting a refresh in the module:engine/model/differ~Differ).
You can use it if you want the view representation of a specific item updated as a response to external modifications. For instance, when the view structure depends not only on the associated model data but also on some external state.
Note: If you want to reconvert a model marker, use #reconvertMarker instead.
Item to refresh.
Calling this method will refresh the marker by triggering the downcast conversion for it.
Reconverting the marker is useful when you want to change its module:engine/view/element~ViewElement view element without changing any marker data. For instance:
let isCommentActive = false;
model.conversion.markerToHighlight( {
model: 'comment',
view: data => {
const classes = [ 'comment-marker' ];
if ( isCommentActive ) {
classes.push( 'comment-marker--active' );
}
return { classes };
}
} );
// ...
// Change the property that indicates if marker is displayed as active or not.
isCommentActive = true;
// Reconverting will downcast and synchronize the marker with the new isCommentActive state value.
editor.editing.reconvertMarker( 'comment' );
Note: If you want to reconvert a model item, use #reconvertItem instead.
Name of a marker to update, or a marker instance.
A controller for the editing pipeline. The editing pipeline controls the ~EditingController#model model rendering, including selection handling. It also creates the ~EditingController#view view which builds a browser-independent virtualization over the DOM elements. The editing controller also attaches default converters.