UndoManager Class
Stores the sequence of operations performed on a Markup. Facilitates undo/redo of the operations.
Methods
Name | Description | |
---|---|---|
constructor(): UndoManager | ||
doRedo(): void | reinstate the most recently reversed operation, if any | |
doUndo(): void | reverse the most recent operation, if any | |
onAdded(elem: Element): void | call this from within a UndoManager.performOperation function after an element has been added to a markup | |
onDelete(elem: Element): void | call this from within a UndoManager.performOperation function before an element is about to be deleted from a markup | |
onModified(newElem: Element, oldElem: Element): void | call this from within a UndoManager.performOperation function after an element has been modified in a markup | |
onRepositioned(elem: Element, oldIndex: number, oldParent: Element): void | call this from within a UndoManager.performOperation function after an element has been moved in display order in a markup | |
performOperation(cmdName: string, fn: VoidFunction): void | Perform a series of changes to markup elements that should all be reversed as a single operation. |
Properties
Defined in
- markup/src/Undo.ts Line 106
Last Updated: 30 November, 2023