Methods
add(cmd)
Add a command to the stack.
Parameters:
Name | Type | Description |
---|---|---|
cmd | object | The command to add. |
- Source
Fires:
addEventListener(type, callback)
Add an event listener to this class.
Parameters:
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
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:
removeEventListener(type, callback)
Remove an event listener from this class.
Parameters:
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
Fires:
Events
redo
Command redo event.
Type:
Properties- object
Name | Type | Description |
---|---|---|
command | string | The name of the redone command. |
- Source
undo
Command undo event.
Type:
Properties- object
Name | Type | Description |
---|---|---|
command | string | The name of the undone command. |
- Source
undoadd
Command add to undo stack event.
Type:
Properties- object
Name | Type | Description |
---|---|---|
command | string | The name of the command added to the undo stack. |
- Source