UndoStack

dwv.tool. UndoStack

new UndoStack()

Source:

UndoStack class.

Methods

add(cmd)

Source:

Add a command to the stack.

Parameters:
Name Type Description
cmd object

The command to add.

Fires:

addEventListener(type, callback)

Source:

Add an event listener to this class.

Parameters:
Name Type Description
type string

The event type.

callback object

The method associated with the provided event type, will be called with the fired event.

getStack() → {Array}

Source:

Get the stack.

Returns:

The list of stored commands.

Type
Array

redo()

Source:

Redo the last command.

Fires:

removeEventListener(type, callback)

Source:

Remove an event listener from this class.

Parameters:
Name Type Description
type string

The event type.

callback object

The method associated with the provided event type.

undo()

Source:

Undo the last command.

Fires:

Events

redo

Source:
Properties:
Name Type Description
command string

The name of the redone command.

Command redo event.

Type:
  • object

undo

Source:
Properties:
Name Type Description
command string

The name of the undone command.

Command undo event.

Type:
  • object

undoadd

Source:
Properties:
Name Type Description
command string

The name of the command added to the undo stack.

Command add to undo stack event.

Type:
  • object