Report an issue
Class

MarkerOperation (engine/model/operation)

@ckeditor/ckeditor5-engine/src/model/operation/markeroperation

class

Filtering

Properties

  • affectsData : Boolean

    readonly

    Specifies whether the marker operation affects the data produced by the data pipeline (is persisted in the editor's data).

  • baseVersion : Number

    inherited

    version on which operation can be applied. If you try to apply operation with different base version than the document version the model-document-applyOperation-wrong-version error is thrown.

  • delta : Delta

    inherited

    Delta which the operation is a part of. This property is set by the delta when the operations is added to it by the addOperation method.

  • isDocumentOperation : Boolean

    readonly inherited

    Defines whether operation is executed on attached or detached items.

  • name : String

    readonly

    Marker name.

  • newRange : Range

    readonly

    Marker range after the change.

  • oldRange : Range

    readonly

    Marker range before the change.

  • type : String

    readonly inherited

    Operation type.

    Overrides: Operation#type
  • _markers : MarkerCollection

    private

    Marker collection on which change should be executed.

Static properties

  • className : String

    inherited static

    Name of the operation class used for serialization.

Methods

  • constructor( name, oldRange, newRange, markers, baseVersion, affectsData )

    Parameters

    name : String

    Marker name.

    oldRange : Range

    Marker range before the change.

    newRange : Range

    Marker range after the change.

    markers : MarkerCollection

    Marker collection on which change should be executed.

    baseVersion : Number | null

    Document version on which operation

    affectsData : Boolean

    Specifies whether the marker operation affects the data produced by the data pipeline (is persisted in the editor's data). can be applied or null if the operation operates on detached (non-document) tree.

  • clone() → MarkerOperation

    Creates and returns an operation that has the same parameters as this operation.

    Returns

    MarkerOperation

    Clone of this operation.

    Overrides: Operation#clone
  • getReversed() → MarkerOperation

  • toJSON() → Object

    inherited

    Custom toJSON method to solve child-parent circular dependencies.

    Returns

    Object

    Clone of this object with the delta property replaced with string.

    Overrides: Operation#toJSON
  • _execute()

    protected inherited

    Executes the operation - modifications described by the operation properties will be applied to the model tree.

    Overrides: Operation#_execute
  • _validate()

    protected inherited

    Checks whether the operation's parameters are correct and the operation can be correctly executed. Throws an error if operation is not valid.

Static methods

  • fromJSON( json, document ) → MarkerOperation

    static

    Creates MarkerOperation object from deserialized object, i.e. from parsed JSON string.

    Parameters

    json : Object

    Deserialized JSON object.

    document : Document

    Document on which this operation will be applied.

    Returns

    MarkerOperation