UndoManager

优质
小牛编辑
135浏览
2023-12-01

This object maintains the undo stack for an EditSession.

Constructors

  • new UndoManager()

Resets the current undo state and creates a new UndoManager.

Methods

  • UndoManager.execute(Object options)

Provides a means for implementing your own undo manager. options has one property, args, an Array, with two elements:

  • args[0] is an array of deltas
  • args[1] is the document to associate with
optionsObjectRequired. Contains additional properties
  • UndoManager.hasRedo()
  • 返回值: Boolean

Returns true if there are redo operations left to perform.

  • UndoManager.hasUndo()
  • 返回值: Boolean

Returns true if there are undo operations left to perform.

  • UndoManager.redo(Boolean dontSelect)

Perform a redo operation on the document, reimplementing the last change.

dontSelectBooleanRequired. If true, doesn't select the range of where the change occurred
  • UndoManager.reset()

Destroys the stack of undo and redo redo operations.

Perform an undo operation on the document, reverting the last change.

dontSelectBooleanRequired. If true, doesn't select the range of where the change occurred