Skip to main content

Home > @jsplumbtoolkit/core > UndoRedoManager

UndoRedoManager class#

Manager for undo/redo operations on a JsPlumbToolkit instance. An instance of JsPlumbToolkit creates one of these automatically so there is no need for library users to instantiate one.

Signature:

export declare class UndoRedoManager 

Constructors#

ConstructorModifiersDescription
(constructor)(params)Constructs a new instance of the UndoRedoManager class

Properties#

PropertyModifiersTypeDescription
compoundboolean
maximumSizenumber
onChangeOnChangeFunction
suspendboolean
toolkitJsPlumbToolkit

Methods#

MethodModifiersDescription
clear()Clears both stacks and fires an update event.
commitTransaction()
edgeChange(previousId, newEdge)Notification that some edge has been replaced with a copy. This occurs when an edge removed is undone or an edge add is redone. we need to update all references to the previous edge with this new one, as the toolkit no longer knows about the old edge. This is not a method that should be called from outside of the undo manager.
openTransaction(cleanupAction)
redo()Re-execute the last command in the redo stack, if it isn't empty.
rollbackTransaction()
transaction(fn, cleanupAction)Run a series of operations as a single transaction in the undo stack, meaning that they will all be undone/redone at once.
undo()Execute undo on the last command in the undo stack, if it isn't empty.