Module: PanelUtils

PanelUtils is a singleton that defines panel related utility functions.

Source:

Methods

activate(panel)

The function parses all links in the panel and adds corresponding handlers.

The function parses all links in the panel and adds corresponding handlers. There are three types of links:

  • a[href^="http"]: External link
  • a[href^="tel"]: External link
  • [data-href]: Generic dialog link and settings-specific dialog link
Parameters:
Name Type Description
panel HTMLElement

The root element of the panel.

Source:

onInputChange(panel, event)

Respond to settings changes.

Respond to settings changes. The supported formats are:

  • An input element with a "name" attribute and its value is a settings key.
  • A select element with a "name" attribute and its value is a settings key.
  • A span element with a "data-name" attribute and its value is a settings key.
  • Elements with a "data-show-name" attribute. It hides the element when the value is false and vice versa.
Parameters:
Name Type Description
panel HTMLElement
event Event
Source:

onLinkClick(event)

When a link element is clicked, the function navigates the app to the panel of the id specified by the "href" attribute of the element.

When a link element is clicked, the function navigates the app to the panel of the id specified by the "href" attribute of the element.

Parameters:
Name Type Description
event Event
Source:

onSettingsChange(panel, event)

Respond to settings changes.

Respond to settings changes. The supported formats are:

  • An input element with a "name" attribute and its value is a settings key.
  • A select element with a "name" attribute and its value is a settings key.
  • A span element with a "data-name" attribute and its value is a settings key.
  • Elements with a "data-show-name" attribute. It hides the element when the value is false and vice versa.
Parameters:
Name Type Description
panel HTMLElement
event Event
Source:

preset(panel)

The function presets elements with the settings values.

The function presets elements with the settings values. The supported formats are:

  • An input element with a "name" attribute and its value is a settings key.
  • A select element with a "name" attribute and its value is a settings key.
  • A span element with a "data-name" attribute and its value is a settings key.
Parameters:
Name Type Description
panel HTMLElement

The root element of the panel.

Source: