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
-
isFocused : Boolean
module:comments/annotations/annotationcollection~AnnotationCollection#isFocused
Equals to
true
when one of the annotation in the collection is focused.
Methods
-
constructor( [ annotations ] )
module:comments/annotations/annotationcollection~AnnotationCollection#constructor
Parameters
[ annotations ] : Iterable.<Annotation>
Initial annotations.
-
add( annotation )
module:comments/annotations/annotationcollection~AnnotationCollection#add
Adds an annotation to the collection.
Parameters
annotation : Annotation
-
destroy()
module:comments/annotations/annotationcollection~AnnotationCollection#destroy
Destroys all bindings and clears the collection.
-
getByInnerView( innerView ) → Annotation
module:comments/annotations/annotationcollection~AnnotationCollection#getByInnerView
Gets the annotation for a given annotation view's inner view.
-
getByView( view ) → Annotation
module:comments/annotations/annotationcollection~AnnotationCollection#getByView
Gets the annotation for a given annotation view.
-
refreshPositioning()
module:comments/annotations/annotationcollection~AnnotationCollection#refreshPositioning
Refreshes the positioning of all annotations and sorts them topmost and leftmost.
-
remove( annotation )
module:comments/annotations/annotationcollection~AnnotationCollection#remove
Removes the annotation from the collection.
Parameters
annotation : Annotation
Events
-
blur( eventInfo )
module:comments/annotations/annotationcollection~AnnotationCollection#event:blur
Fired when all annotations become blurred.
Parameters
eventInfo : EventInfo
An object containing information about the fired event.
-
focus( eventInfo, annotation )
module:comments/annotations/annotationcollection~AnnotationCollection#event:focus
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.