Report an issue
Class

MarkerOperation (engine/model/operation)

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

class

Filtering

Properties

Static properties

  • className : String

    inherited static

    Name of the operation class used for serialization.

Methods

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

    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 can be applied or null if the operation operates on detached (non-document) tree.

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

    Returns

    MarkerOperation

    Clone of this operation.

    Overrides: Operation#clone
  • 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 deserilized 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