new FlipClock(el, value, attributesopt)
Create a new FlipClock instance.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
el |
HTMLElement | The HTML element used to bind clock DOM node. |
|
value |
* | The value that is passed to the clock face. |
|
attributes |
object | undefined |
<optional> |
The instance attributes. |
- Source:
Extends
Members
(static) defaults
Get the global default values.
- Source:
className
Get the className attribute. Used for CSS. Kebab cases the name
property by default.
- Inherited From:
- Source:
el
Get the component's top level DOM node.
- Overrides:
- Source:
events
Get the events attribute.
- Inherited From:
- Source:
face
Get the clock Face.
- Source:
face
Sets the clock Face.
- Source:
language
Get the language attribute.
- Overrides:
- Source:
name
Get the name attribute. Uses the this.constructor.name by default.
- Inherited From:
- Source:
originalValue
Get the original value attribute.
- Source:
originalValue
Set the original value attribute.
- Source:
parent
Get the parent attribute. Parent is set when DomComponent instances are
mounted.
- Overrides:
- Source:
stopAt
Get the stopAt attribute.
- Source:
stopAt
Set the stopAt attribute.
- Source:
theme
Get the theme attribute.
- Overrides:
- Source:
timer
Get the Timer instance.
- Source:
timer
Set the Timer instance.
- Source:
value
Helper method to get the clock's FaceValue instance.
- Source:
value
Helper method to set the clock's FaceValue instance.
- Source:
Methods
(static) setDefaultFace(value) → {void}
Helper method to set the default Face value.
Parameters:
| Name | Type | Description |
|---|---|---|
value |
Face | The default |
- Source:
Returns:
- Type
- void
(static) setDefaultLanguage(value) → {void}
Helper method to set the default language.
Parameters:
| Name | Type | Description |
|---|---|---|
value |
object | The default language. |
- Source:
Returns:
- Type
- void
(static) setDefaultTheme(value) → {void}
Helper method to set the default theme.
Parameters:
| Name | Type | Description |
|---|---|---|
value |
object | The default theme. |
- Source:
Returns:
- Type
- void
callback(fn) → {*}
Helper method to execute the callback() function.
Parameters:
| Name | Type | Description |
|---|---|---|
fn |
function | The callback function. |
- Inherited From:
- Source:
Returns:
- Returns the executed callback function.
- Type
- *
createDivider(attributesopt) → {Divider}
Helper method to instantiate a new Divider.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
attributes |
object | undefined |
<optional> |
The attributes passed to the
|
- Source:
Returns:
- The instantiated Divider.
- Type
- Divider
createGroup(items, attributesopt) → {Group}
Helper method to instantiate a new Group.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
items |
array | An array of |
|
attributes |
Group | undefined |
<optional> |
The attributes passed to the
|
- Source:
Returns:
- The instantiated
Group.
- Type
- Group
createLabel(value, attributesopt) → {Label}
Helper method to instantiate a new Label.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
value |
* | The |
|
attributes |
object | undefined |
<optional> |
The attributes passed to the
|
- Source:
Returns:
- The instantiated
Label.
- Type
- Label
createList(value, attributesopt) → {List}
Helper method to instantiate a new List.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
value |
* | The |
|
attributes |
object | undefined |
<optional> |
The attributes passed to the
|
- Source:
Returns:
- The instantiated
List.
- Type
- List
decrement(value) → {FlipClock}
Helper method to decrement the clock's value.
Parameters:
| Name | Type | Description |
|---|---|---|
value |
* | undefined | Decrement the clock by the specified value.
If no value is passed, then the default decrement is determined by
the |
- Source:
Returns:
- The
FlipClockinstance.
- Type
- FlipClock
emit(key) → {Component}
Emit an event.
Parameters:
| Name | Type | Description |
|---|---|---|
key |
string | The event id/key. |
- Inherited From:
- Source:
Returns:
- Returns
thisinstance.
- Type
- Component
getAttribute(key) → {*}
Get an attribute. Returns null if no attribute is defined.
Parameters:
| Name | Type | Description |
|---|---|---|
key |
string | The attribute name. |
- Inherited From:
- Source:
Returns:
- The attribute value.
- Type
- *
getAttributes() → {object}
Get all the atttributes for this instance.
- Inherited From:
- Source:
Returns:
- The attribute dictionary.
- Type
- object
getPublicAttributes() → {object}
Get only public the atttributes for this instance. Omits any attribute
that starts with $, which is used internally.
- Inherited From:
- Source:
Returns:
- The attribute dictionary.
- Type
- object
increment(value) → {FlipClock}
Helper method to increment the clock's value.
Parameters:
| Name | Type | Description |
|---|---|---|
value |
* | undefined | Increment the clock by the specified value.
If no value is passed, then the default increment is determined by
the Face, which is usually |
- Source:
Returns:
- The
FlipClockinstance.
- Type
- FlipClock
mount(el) → {FlipClock}
Mount the clock to the parent DOM element.
Parameters:
| Name | Type | Description |
|---|---|---|
el |
HTMLElement | The parent |
- Overrides:
- Source:
Returns:
- The
FlipClockinstance.
- Type
- FlipClock
off(key, fn) → {Component}
Stop listening to an event.
Parameters:
| Name | Type | Description |
|---|---|---|
key |
string | The event id/key. |
fn |
function | undefined | The listener callback function. If no function is defined, all events with the specified id/key will be removed. Otherwise, only the event listeners matching the id/key AND callback will be removed. |
- Inherited From:
- Source:
Returns:
- Returns
thisinstance.
- Type
- Component
on(key, fn, onceopt) → {Component}
Start listening to an event.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
key |
string | The event id/key. |
||
fn |
function | The listener callback function. |
||
once |
boolean |
<optional> |
false | Should the event handler be fired a single time. |
- Inherited From:
- Source:
Returns:
- Returns
thisinstance.
- Type
- Component
once(key, fn) → {Component}
Listen to an event only one time.
Parameters:
| Name | Type | Description |
|---|---|---|
key |
string | The event id/key. |
fn |
function | The listener callback function. |
- Inherited From:
- Source:
Returns:
- Returns
thisinstance.
- Type
- Component
render() → {HTMLElement}
Render the clock's DOM nodes.
- Overrides:
- Source:
Returns:
The parent HTMLElement.
- Type
- HTMLElement
reset(fn) → {FlipClock}
Reset the clock to the original value.
Parameters:
| Name | Type | Description |
|---|---|---|
fn |
function | The interval callback. |
- Source:
Returns:
- The
FlipClockinstance.
- Type
- FlipClock
setAttribute(key, value) → {void}
Set an attribute key and value.
Parameters:
| Name | Type | Description |
|---|---|---|
key |
string | The attribute name. |
value |
* | The attribute value. |
- Inherited From:
- Source:
Returns:
- Type
- void
setAttributes(values) → {void}
Set an attributes by object of key/value pairs.
Parameters:
| Name | Type | Description |
|---|---|---|
values |
object | The object dictionary. |
- Inherited From:
- Source:
Returns:
- Type
- void
start(fn) → {FlipClock}
Start the clock.
Parameters:
| Name | Type | Description |
|---|---|---|
fn |
function | The interval callback. |
- Source:
Returns:
- The
FlipClockinstance.
- Type
- FlipClock
stop(fn) → {FlipClock}
Stop the clock.
Parameters:
| Name | Type | Description |
|---|---|---|
fn |
function | The stop callback. |
- Source:
Returns:
- The
FlipClockinstance.
- Type
- FlipClock
translate(string) → {string}
Translate a string.
Parameters:
| Name | Type | Description |
|---|---|---|
string |
string | The string to translate. |
- Inherited From:
- Source:
Returns:
- The translated string. If no tranlation found, the untranslated string is returned.
- Type
- string