Class: ChangeElementCommand

history.ChangeElementCommand(elem, attrs, text)

History command to make a change to an element. Usually an attribute change, but can also be textcontent.

Constructor

new ChangeElementCommand(elem, attrs, text)

Parameters:
Name Type Description
elem Element

The DOM element that was changed

attrs module:history.CommandAttributes

Attributes to be changed with the values they had before the change

text string

An optional string visible to user related to this change

Implements:
Source:

Methods

apply(handler) → {true}

Performs the stored change action.

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

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) → {true}

Reverses the stored change action.

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