AnnotationCollection (comments/annotations)
@ckeditor/ckeditor5-comments/src/annotations/annotationcollection
A collection of annotations.
It implements methods for managing annotations and creates a focus tracker for them to make it easier to manage the focus for all annotations.
AnnotationCollection
fires event-focus
when an annotation
becomes focused and event-blur
when all annotations
lose focus.
Filtering
Properties
-
Equals to
true
when one of the annotation in the collection is focused.
Methods
-
constructor( [ annotations ] )
Parameters
[ annotations ] : Iterable.<Annotation>
Initial annotations.
-
add( annotation )
Adds an annotation to the collection.
Parameters
annotation : Annotation
-
Destroys all bindings and clears the collection.
-
getByInnerView( innerView ) → Annotation
Gets the annotation for a given annotation view's inner view.
-
getByView( view ) → Annotation
Gets the annotation for a given annotation view.
-
Refreshes the positioning of all annotations and sorts them topmost and leftmost.
-
remove( annotation )
Removes the annotation from the collection.
Parameters
annotation : Annotation
Events
-
blur( eventInfo )
Fired when all annotations become blurred.
Parameters
eventInfo : EventInfo
An object containing information about the fired event.
-
focus( eventInfo, annotation )
Fired when an annotation becomes active.
Parameters
eventInfo : EventInfo
An object containing information about the fired event.
annotation : Annotation
An annotation that was focused.
Every day, we work hard to keep our documentation complete. Have you spotted an outdated information? Is something missing? Please report it via our issue tracker.