MAF.element.Core

This is the base class for all MAF components. This component does not act on events from its element. Extended classes should define if they want to act on them.

new MAF.element.Core()

Properties:
NameTypeDescription
widthNumber

Width of the component

heightNumber

Height of the component

hAlignString
vAlignString
hOffsetNumber
vOffsetNumber

Configs

events : {Object}

A object containing one or more event handlers to be added to this object during initialization.

The possible events are defined on each component.

Example
MAF.element.Core({
   events: {
      onAppend: function () {
      	// do something
      }
   }
}).appendTo(this);

id : {String}

The unique id of this class

styles : {Object}

CSS styles for the component:

NameTypeArgumentDefaultDescription
widthNumber

The width of this component in pixels.

heightNumber

The height of this component in pixels.

hAlignStringoptional left

Horizontal alignment of this component. (left, center, right)

vAlignStringoptional top

Vertical alignment of this component. (top, center, bottom)

hOffsetNumberoptional 

Horizontal offset of this component in pixels.

vOffsetNumberoptional 

Vertical offset of this component.

Methods

animate(config)

Parameters:

NameTypeDescription
configObject

A config object

Fires:

freeze() → {Class}

Freezes this component. Screen renders no longer trigger until thawed.

Returns:

This component.

getAbsolutePosition() → {Object}

Give back the position relative to its first positioned ancestor element

Returns:

{hOffset:Number, vOffset: Number}

getView() → {Class}

Returns:

Returns the view this class is appended on.

hide() → {Class}

Hides this component.

Returns:

This component.

initialize()

Initialize the class

show() → {Class}

Shows this component.

Returns:

This component.

thaw() → {Class}

Thawes this component. Screen renders can trigger again.

Returns:

This component.

Events

onAnimationEnded

Fired when a animation on this component has ended.

onAppend

Fired when component has appended to a parent. Update visual appearances by applying a Theme style and rendering the skin.