UndoManager Class

Beta

Stores the sequence of operations performed on a Markup. Facilitates undo/redo of the operations.

Methods

Name Description
doRedo(): void reinstate the most recently reversed operation, if any  
doUndo(): void reverse the most recent operation, if any  
onAdded(elem: MarkupElement): void call this from within a UndoManager.performOperation function after an element has been added to a markup  
onDelete(elem: MarkupElement): void call this from within a UndoManager.performOperation function before an element is about to be deleted from a markup  
onModified(newElem: MarkupElement, oldElem: MarkupElement): void call this from within a UndoManager.performOperation function after an element has been modified in a markup  
onRepositioned(elem: MarkupElement, oldIndex: number, oldParent: MarkupElement): 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

Name Type Description
redoPossible Accessor ReadOnly boolean determine whether there are any reversed operations  
redoString Accessor ReadOnly undefined | string the name of the operation that can be redone (or undefined)  
size Accessor ReadOnly number    
undoPossible Accessor ReadOnly boolean determine whether there are any un-reversed operations  
undoString Accessor ReadOnly undefined | string the name of the operation that can be undone (or undefined)  

Defined in

Last Updated: 20 September, 2019