Member Summary
Public Members | ||
public |
Caution: the selector doesn't verify if elements are visible.
|
|
public |
Caution: the selector doesn't verify if elements are visible.
|
|
public |
Returns Coral global options retrieved on the
|
Method Summary
Public Methods | ||
public |
addResizeListener(element: HTMLElement, onResize: Function) Adds a resize listener to the given element. |
|
public |
Copy the properties from the source object to the destination object, but calls the callback if the property is already present on the destination object. |
|
public |
Call all of the provided functions, in order, returning the return value of the specified function. |
|
public |
Copy the properties from all provided objects into the first object. |
|
public |
getSubProperty(root: Object, path: String): * Get the value of the property at the given nested path. |
|
public |
Get a unique ID. |
|
public |
isAndroid(): * |
|
public |
Execute the provided callback on the next animation frame. |
|
public |
ready(element: HTMLElement, onDefined: CommonsReadyCallback) Checks if Coral components and all nested Coral components are defined as Custom Elements. |
|
public |
removeResizeListener(element: HTMLElement, onResize: Function) Removes a resize listener from the given element. |
|
public |
setSubProperty(root: Object, path: String, obj: String) Assign an object given a nested path |
|
public |
swapKeysAndValues(obj: Object): Object Return a new object with the swapped keys and values of the provided object. |
|
public |
transitionEnd(element: HTMLElement, onTransitionEndCallback: CommonsTransitionEndCallback) Execute the provided callback once a CSS transition has ended. |
Public Members
public FOCUSABLE_ELEMENT_SELECTOR: String source
Caution: the selector doesn't verify if elements are visible.
read-only
public TABBABLE_ELEMENT_SELECTOR: String source
Caution: the selector doesn't verify if elements are visible.
read-only
public options: Object: * source
Returns Coral global options retrieved on the <script>
data attributes including:
[data-coral-icons]
: source folder of the SVG icons. If the icon collections have a custom name, they have to be loaded manually using Icon.load.[data-coral-icons-external]
: Whether SVG icons are always referenced as external resource. Possible values are "on" (default), "off" or "js" to load icons from a script.[data-coral-typekit]
: custom typekit id used to load the fonts.[data-coral-logging]
: defines logging level. Possible values are "on" (default) or "off".
Public Methods
public addResizeListener(element: HTMLElement, onResize: Function) source
Adds a resize listener to the given element.
Params:
Name | Type | Attribute | Description |
element | HTMLElement | The element to add the resize event to. |
|
onResize | Function | The resize callback. |
public augment(dest: Object, source: ...Object, handleCollision: CommonsHandleCollision): Object source
Copy the properties from the source object to the destination object, but calls the callback if the property is already present on the destination object.
Params:
Name | Type | Attribute | Description |
dest | Object | The object to copy properties to |
|
source | ...Object | An object to copy properties from. Additional objects can be passed as subsequent arguments. |
|
handleCollision | CommonsHandleCollision |
|
Called if the property being copied is already present on the destination. The return value will be used as the property value. |
public callAll(func: ...Function, nth: Number): Function source
Call all of the provided functions, in order, returning the return value of the specified function.
public extend(dest: Object, source: ...Object): Object source
Copy the properties from all provided objects into the first object.
public getSubProperty(root: Object, path: String): * source
Get the value of the property at the given nested path.
Return:
* | The value of the provided property. |
Throw:
* |
Will throw an error if the path is not present on the object. |
public nextFrame(onNextFrame: Function): * source
Execute the provided callback on the next animation frame.
Params:
Name | Type | Attribute | Description |
onNextFrame | Function | The callback to execute. |
Return:
* |
public ready(element: HTMLElement, onDefined: CommonsReadyCallback) source
Checks if Coral components and all nested Coral components are defined as Custom Elements.
Params:
Name | Type | Attribute | Description |
element | HTMLElement | The element that should be watched. |
|
onDefined | CommonsReadyCallback | The callback to call when all components are ready. |
public removeResizeListener(element: HTMLElement, onResize: Function) source
Removes a resize listener from the given element.
Params:
Name | Type | Attribute | Description |
element | HTMLElement | The element to remove the resize event from. |
|
onResize | Function | The resize callback. |
public setSubProperty(root: Object, path: String, obj: String) source
Assign an object given a nested path
Throw:
* |
Will throw an error if the path is not present on the object. |
public swapKeysAndValues(obj: Object): Object source
Return a new object with the swapped keys and values of the provided object.
Params:
Name | Type | Attribute | Description |
obj | Object | The object to copy. |
public transitionEnd(element: HTMLElement, onTransitionEndCallback: CommonsTransitionEndCallback) source
Execute the provided callback once a CSS transition has ended. This method listens for the next transitionEnd event on the given DOM element. In case the provided element does not have a transition defined, the callback will be called in the next macrotask to allow a normal application execution flow. It cannot be used to listen continuously on transitionEnd events.
Params:
Name | Type | Attribute | Description |
element | HTMLElement | The DOM element that is affected by the CSS transition. |
|
onTransitionEndCallback | CommonsTransitionEndCallback | The callback to execute. |