Tools

WebstrateComponents. Tools

A collection of tools

Methods

(static) fromConfig(config, key, defaultValueopt)

Description:
  • Tries to extract the entry with the given key from the given config. If key does not exist, returns defaultValue instead.
Source:
Parameters:
Name Type Attributes Default Description
config Object The configuration to extract the entry from
key String The key of the entry to extract
defaultValue * <optional>
null The default value to return if the key does not exist.

(static) isInsideElement(elm, testElement)

Description:
  • Tests if the given testElement is inside the given elm
Source:
Parameters:
Name Type Description
elm Element
testElement Element

(static) loadTemplate(id) → {Element}

Description:
  • Loads a template from the document and returns it
Source:
Parameters:
Name Type Description
id String The identifier of the template to load
Returns:
- The loaded template
Type
Element