Class: InsertElementCommand

history.InsertElementCommand(elem, text)

History command for an element that was added to the DOM.

Constructor

new InsertElementCommand(elem, text)

Parameters:
Name Type Description
elem Element

The newly added DOM element

text string

An optional string visible to user related to this change

Implements:
Source:

Methods

apply(handler) → {void}

Re-inserts the new element.

Parameters:
Name Type Description
handler module:history.HistoryEventHandler
Implements:
Source:
Fires:
Returns:
Type
void

elements() → {Array.<Element>}

Implements:
Source:
Returns:

Array with element associated with this command

Type
Array.<Element>

type() → {string}

Gives the type

Implements:
Source:
Returns:
Type
string

unapply(handler) → {void}

Removes the element.

Parameters:
Name Type Description
handler module:history.HistoryEventHandler
Implements:
Source:
Fires:
Returns:
Type
void