Internal utilities for working with the DOM.
Static Methods
-
DOMUtils.addStylesheet(path, id) common/util/dom_utils.js, line 75
-
Adds a link to a stylesheet into the head of a document.
Argument Type Attributes Description path
String Path to the stylesheet, relative to the Lens root.
id
String <optional>
Optional id to apply to the link tag.
-
DOMUtils.buildEvent(name, bubble, props) common/util/dom_utils.js, line 33
-
Builds a custom event.
Argument Type Attributes Description name
String Name of the event.
bubble
Boolean Whether the event bubbles.
props
Object <optional>
Additional properties for the event.
-
DOMUtils.elementsAt() common/util/dom_utils.js, line 100
-
Returns the topmost element at (x, y) and all of its parents. The most specific element will be the first item in the array, and the document element will be the last item.
-
DOMUtils.fire(name, el, props) → {Boolean} common/util/dom_utils.js, line 20
-
Fires a custom event.
Argument Type Description name
String Name of the event.
el
Element DOM element to fire the event on.
props
Object Additional properties for the event.
Returns false if stopPropagation was called on the event, true otherwise.
-
DOMUtils.fireBubbling(name, el, props) → {Boolean} common/util/dom_utils.js, line 61
-
Fires a custom event that bubbles up the DOM.
Argument Type Description name
String Name of the event.
el
Element DOM element to fire the event on.
props
Object Additional properties for the event.
Returns false if preventDefault was called on the event, true otherwise.
-
DOMUtils.removeStylesheet(path) common/util/dom_utils.js, line 91
-
Unloads a stylesheet.
Argument Type Description path
String Path to the stylesheet, relative to the Lens root.