Methods
add(cmd)
Add a command to the stack.
Name | Type | Description |
---|---|---|
cmd | object | The command to add. |
- Source
addEventListener(type, callback)
Add an event listener to this class.
Name | Type | Description |
---|---|---|
type | string | The event type. |
callback | function | The function associated with the provided event type, will be called with the fired event. |
- Source
getCurrentStackIndex() → {number}
Get the current stack index.
- Source
The stack index.
- Type:
- number
getStackSize() → {number}
Get the stack size.
- Source
The size of the stack.
- Type:
- number
redo()
Redo the last command.
- Source
remove(name) → {boolean}
Remove a command to the stack.
Name | Type | Description |
---|---|---|
name | string | The name of the command to remove. |
- Source
True if the command was found and removed.
- Type:
- boolean
removeEventListener(type, callback)
Remove an event listener from this class.
Name | Type | Description |
---|---|---|
type | string | The event type. |
callback | function | The function associated with the provided event type. |
- Source
undo()
Undo the last command.
- Source
Events
redo
Command redo event.
- object
Name | Type | Description |
---|---|---|
type | string | The event type. |
command | string | The name of the redone command. |
- Source
undo
Command undo event.
- object
Name | Type | Description |
---|---|---|
type | string | The event type. |
command | string | The name of the undone command. |
- Source
undoadd
Command add to undo stack event.
- object
Name | Type | Description |
---|---|---|
type | string | The event type. |
command | string | The name of the command added to the undo stack. |
- Source
undoremove
Command remove from undo stack event.
- object
Name | Type | Description |
---|---|---|
type | string | The event type. |
command | string | The name of the command added to the undo stack. |
- Source