Library.DOM

Do not use this directly, this Library needs to be implemented on a class.

Example

var myClassPrototype = new MAF.Class({
    Implements: [
       Library.DOM
    ]
 });

Methods

adopt(child)

Append a child or several children to this Class.

Parameters:

NameTypeArgumentDescription
childMAF.Classrepeatable 

Component or element you want to add.

appendChild(child) → {MAF.Class}

This method appends a element as the last child of this Class.

Parameters:

NameTypeDescription
childELement | MAF.Class

Component or element you want to add.

Fires:

  • event:onChildAppended
  • event:onAppend

Returns:

Returns this.

appendTo(parent)

Add this class element as a child to the specified class.

Parameters:

NameTypeDescription
parentMAF.Class

Which class to append to.

detachChild(child) → {Element}

Remove a child.

Parameters:

NameTypeDescription
childString | Number | Element

String can be first or last, Number is position of the child. Element is the child itself.

Returns:

The detached child element.

empty() → {MAF.Class}

Remove all Children from this Class

Returns:

Returns this.

moveTo(parent)

Move the Class element to a different class.

Parameters:

NameTypeDescription
parentMAF.Class

Which class to move to.

removeChild(child) → {Element}

Remove a child.

Parameters:

NameTypeDescription
childString | Number | Element

String can be first or last, Number is position of the child. Element is the child itself.

Fires:

  • event:onChildRemoved

Returns:

The removed child element.

removeChildren()

Remove all children.

suicide()

Destroy and cleanup this Class and all its children.