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:

Name Type Argument Description
child MAF.Class repeatable 

Component or element you want to add.

appendChild(child) → {MAF.Class}

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

Parameters:

Name Type Description
child ELement | 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:

Name Type Description
parent MAF.Class

Which class to append to.

detachChild(child) → {Element}

Remove a child.

Parameters:

Name Type Description
child String | 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:

Name Type Description
parent MAF.Class

Which class to move to.

removeChild(child) → {Element}

Remove a child.

Parameters:

Name Type Description
child String | 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.