photonui.Helpers Class
Helpers.
Constructor
photonui.Helpers
()
Item Index
Methods
- cleanNode static
- escapeHtml static
- getAbsolutePosition static
- getClosest
- log static
- numberToCssSize static
- uuid4 static deprecated
Methods
cleanNode
(
static
-
node
Clean node (remove all children of the node).
Parameters:
-
node
HTMLElement
getAbsolutePosition
(
Object
static
-
element
Get the absolute position of an HTML Element.
Parameters:
-
element
HTMLElementThe HTML element (or its id)
Returns:
Object:
`{x:
getClosest
(
Boolean | Element
-
elem
-
selector
Get the closest matching element up the DOM tree. https://gomakethings.com/climbing-up-and-down-the-dom-tree-with-vanilla-javascript/
log
(
static
-
level
-
message
Write log into the terminal.
numberToCssSize
(
String
static
-
value
-
defaultValue
-
nullValue
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 -> "
Parameters:
Returns:
String:
sanitized version of the size.