new FlipClock(el, value, attributes)
Create a new FlipClock
instance.
Parameters:
Name | Type | 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 |
|
- Source:
Extends
Namespaces
Members
(static) defaults :object
The defaults
attribute.
Type:
- object
- Source:
className :string
The className
attribute. Used for CSS.
Type:
- string
- Inherited From:
- Source:
el :HTMLElement
The el
attribute.
Type:
- HTMLElement
- Inherited From:
- Source:
events :object
The events
attribute.
Type:
- object
- Inherited From:
- Source:
language :object
Get the language attribute.
Type:
- object
- Inherited From:
- Source:
name :string
Get the name
attribute.
Type:
- string
- Inherited From:
- Source:
parent :DomComponent
The parent
attribute. Parent is set when DomComponent
instances are
mounted.
Type:
- Inherited From:
- Source:
theme :object
The theme
attribute.
Type:
- object
- Inherited From:
- Source:
value :FaceValue|null
Helper method to The clock's FaceValue
instance.
Type:
- FaceValue | null
- Source:
Methods
(static) defineName() → {string}
Define the name of the class.
- Source:
Returns:
- Type
- string
(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
FlipClock
instance.
- Type
- FlipClock
emit(key) → {Component}
Emit an event.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | The event id/key. |
- Inherited From:
- Source:
Returns:
- Returns
this
instance.
- 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
FlipClock
instance.
- 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
FlipClock
instance.
- 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
this
instance.
- 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
this
instance.
- 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
this
instance.
- 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
FlipClock
instance.
- 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
FlipClock
instance.
- Type
- FlipClock
stop(fn) → {FlipClock}
Stop the clock.
Parameters:
Name | Type | Description |
---|---|---|
fn |
function | The stop callback. |
- Source:
Returns:
- The
FlipClock
instance.
- 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