Methods
add(cmd)
Add a command to the stack.
Parameters:
Name | Type | Description |
---|---|---|
cmd | object | The command to add. |
- Source
Fires:
getCurrentCommand() → {object}
Get the current command.
- Source
Returns:
The command.
- Type:
- object
getCurrentStackIndex() → {number}
Get the current stack index. Warning: 1 based.
- Source
Returns:
The stack index.
- Type:
- number
getStackSize() → {number}
Get the stack size.
- Source
Returns:
The size of the stack.
- Type:
- number
redo()
Redo the last command.
- Source
Fires:
remove(name) → {boolean}
Remove a command from the stack.
Parameters:
Name | Type | Description |
---|---|---|
name | string | The name of the command to remove. |
- Source
Returns:
True if the command was found and removed.
- Type:
- boolean
undo()
Undo the last command.
- Source
Fires:
Events
redo
Command redo event. event.target.getCurrentCommand()
will return the re-done command.
Type:
- Event
- Source
undo
Command undo event. event.target.getCurrentCommand()
will return the undone command.
Type:
- Event
- Source
undoadd
Add command to undo stack event. event.target.getCurrentCommand()
will return the added command.
Type:
- Event
- Source
undoremove
Remove command from undo stack event. Get the removed command name from the event.detail
.
Type:
- CustomEvent
- Source