API Docs for: 1.8.0
Show:

photonui.Helpers Class

Defined in: src/helpers.js:42
Module: Helpers
Parent Module: PhotonUI

Helpers.

Constructor

photonui.Helpers

()

Defined in src/helpers.js:42

Item Index

Methods

Methods

cleanNode

(
  • node
)
static

Defined in src/helpers.js:81

Clean node (remove all children of the node).

Parameters:

escapeHtml

(
  • string
)
String static

Defined in src/helpers.js:51

Escape HTML.

Parameters:

Returns:

getAbsolutePosition

(
  • element
)
Object static

Defined in src/helpers.js:94

Get the absolute position of an HTML Element.

Parameters:

Returns:

Object:

`{x: , y: }

getClosest

(
  • elem
  • selector
)
Boolean | Element

Defined in src/helpers.js:205

Parameters:

  • elem Element

    Starting element

  • selector String

    Selector to match against

Returns:

Boolean | Element:

Returns null if not match found

log

(
  • level
  • message
)
static

Defined in src/helpers.js:181

Write log into the terminal.

Parameters:

  • level String

    The log level ("info", "warn", "error", ...)

  • message String

    The message to log

numberToCssSize

(
  • value
  • defaultValue
  • nullValue
)
String static

Defined in src/helpers.js:149

Check and compute size to valid CSS size

Valid values and transformations: undefined -> defaultValue null -> "auto" (if "auto" is alowed, "0px" else) +Infinity -> "100%" Number -> "px"

Parameters:

  • value Number
  • defaultValue Number

    (opt, default=nullValue)

  • nullValue String

    (opt, default="auto")

Returns:

String:

sanitized version of the size.

uuid4

() String deprecated static

Defined in src/helpers.js:66

Generate an UUID version 4 (RFC 4122).

This method is deprecated, please use photonui.lib.uuid.v4() instead.

Returns:

String:

The generated UUID