Class: Element

requiem~ui.Element

Abstract class of Node/classes that inherited from Node. Note that this class is an abstract class and must be 'mixed' into an real class.

Members

(static) extends

Gets the existing native element which this custom element extends. This value is used in the `options` for `document.registerElement()`.
Source:

(static) tag

Gets the tag name of this Element instance. This method is meant to be overridden by sub-classes because this class merely provides the foundation functionality of a custom element, hence this class does not register directly with the element registry. This tag name is used by `document.registerElement()`.
Source:

name :string

Instance name of this Element instance. Once set, it cannot be changed.
Type:
  • string
Source:

opacity :number

Opacity of this Element instance.
Type:
  • number
Source:

rect :Object

Rect of this Element instance.
Type:
  • Object
Source:

state :string

State of this Element instance (depicted by Directive.State).
Type:
  • string
Source:

Methods

(static) factory() → {Node}

Creates a new DOM element from this Element class.
Source:
Returns:
Type
Node

addChild()

Source:
See:

addClass()

Source:
See:

destroy()

Method invoked every time before this element is rerendered.
Source:

get(propertyName, defaultInitializeropt) → {*}

Shorthand for creating/accessing private properties.
Parameters:
Name Type Attributes Description
propertyName string Name of private property.
defaultInitializer * <optional>
Optional default value/initializer to set the private property to if it doesn't exist.
Source:
Returns:
Value of private property.
Type
*

getChild()

Source:
See:

getData(key) → {*}

Gets the value of the data property with the specified name.
Parameters:
Name Type Description
key string Name of the data property.
Source:
Returns:
Value of the data property.
Type
*

getStyle()

Source:
See:

hasAttribute()

Source:
See:

hasChild()

Source:
See:

hasClass()

Source:
See:

hasData(key) → {boolean}

Checks to see if this Element instance has the data property of the specified name.
Parameters:
Name Type Description
key string Name of the data property.
Source:
Returns:
True if data property exists, false othwerwise.
Type
boolean

hasEventListener(event, listener) → {boolean}

Determines if a particular listener (or any listener in the specified event) exist in this Element instance.
Parameters:
Name Type Description
event string Event name.
listener function Listener function.
Source:
Returns:
Type
boolean

hasStyle()

Source:
See:

init()

Method invoked every time after this element is rendered.
Source:

isDirty()

Source:
See:
  • ElementUpdateDelegate#isDirty

off()

Source:
See:
  • module:requiem~ui.Element#removeEventListener

on()

Source:
See:
  • module:requiem~ui.Element#addEventListener

removeAllEventListeners()

Removes all cached event listeners from this Element instance.
Source:

removeChild()

Source:
See:

removeClass()

Source:
See:

render()

Renders the template of this element instance.
Source:

respondsTo()

Source:
See:

set(propertyName, value)

Shorthand for modifying private properties.
Parameters:
Name Type Description
propertyName string Name of private property.
value * Value of private property to be set.
Source:

setData()

Defines multiple data properties if the first argument is an object literal (hence using its key/value pairs) or sets a single data property of the specified name with the specified value. If the data property does not exist, it will be newly defined.
Parameters:
Type Description
string | object Name of the data property if defining only one, or an object literal containing key/value pairs to be merged into this Element instance's data properties.
* Value of the data property (if defining only one).
boolean If defining only one data property, specifies whether the data property should also be a data attribute of the element.
Source:

setDirty()

Source:
See:
  • ElementUpdateDelegate#setDirty

setStyle()

Source:
See:

template() → {Node|string}

Creates the associated DOM element from a template.
Source:
Returns:
Type
Node | string

update()

Handler invoked whenever a visual update is required.
Source: