Module

comments/annotations/annotationcollection

@ckeditor/ckeditor5-comments/src/annotations/annotationcollection

module

Filtering

Classes

Functions

  • bindAnnotationCollections( options = { `options.source`, `options.target`, options.filter } )

    A helper function that binds two AnnotationCollections and allows filtering items based on the passed callback.

    Since refreshPositioning sorts the annotations by removing and inserting items, the binding implemented by the bindTo() method is lost. This is why this helper needs to be used.

    This helper is used by the annotation UIs to filter which annotations from the main annotation collection should be handled by agiven annotation UI.

    Parameters

    options : Object
    Properties
    `options.source` : AnnotationCollection

    The source collection from which the annotations will be taken.

    `options.target` : AnnotationCollection

    The target collection that will be synced to the source collection.

    options.filter : function

    Filtering function that gets an annotation and should return true if the annotation should be copied to the target collection.