Class UndoManager
Defined in: UndoManager.js.
Constructor Attributes | Constructor Name and Description |
---|---|
UndoManager(maxStackSize)
Creates a new UndoManager
|
Method Attributes | Method Name and Description |
---|---|
addUndo(undoFunc, redoFunc)
Register an undo operation.
|
|
canRedo()
|
|
canUndo()
|
|
redo()
Redoes the last action.
|
|
reset()
Resets this instance of the undo manager.
|
|
undo()
Undoes the last action.
|
Event Attributes | Event Name and Description |
---|---|
Event that is fired when undo or redo state changes.
|
Class Detail
UndoManager(maxStackSize)
Creates a new UndoManager
- Parameters:
- {Integer} maxStackSize Optional, Default: 64
Method Detail
addUndo(undoFunc, redoFunc)
Register an undo operation. A call to .undo() will cause the undo
function to be executed. If you omit the second argument and the undo
function will cause the registration of another undo operation, then this
operation will be used as the redo function.
If you provide both arguments, a call to addUndo() during an undo() or
redo() will have no effect.
- Parameters:
- {Function} undoFunc
- The function that should undo the changes.
- {Function} redoFunc Optional
- The function that should redo the undone changes.
{Boolean}
canRedo()
- Returns:
- {Boolean} true if redo is possible, false otherwise.
{Boolean}
canUndo()
- Returns:
- {Boolean} true if undo is possible, false otherwise.
redo()
Redoes the last action.
reset()
Resets this instance of the undo manager.
undo()
Undoes the last action.
Event Detail
stateChanged()
Event that is fired when undo or redo state changes.