Class: CUI.dom

Defined in: base/dom.coffee

Overview

Variables Summary

__failedDOMInserts =
0

Class Method Summary

Class Method Details

. (void) data(node, key, data)

. (void) removeData(node, key)

. (void) findElement(node, selector, nodeFilter, forward = true, siblingOnly = false)

find an element starting from node, but never going up

. (void) findNextElement(node, selector, nodeFilter = false, forward = true, siblingOnly = true)

find an element starting from node, with going up

. (void) findPreviousElement(node, selector, nodeFilter = false)

. (void) findNextVisibleElement(node, selector, forward = true)

. (void) findPreviousVisibleElement(node, selector)

. (void) findNextSiblings(node, selector, nodeFilter = false)

. (void) findPreviousSiblings(node, selector, nodeFilter = false)

. (void) findElements(node = document.documentElement, selector = null, nodeFilter = false, maxEls = null, forward = true, siblingOnly = false, elements)

find the next node starting from node start which matches the selector

. (void) children(node, filter)

. (void) firstElementChild(node, nodeFilter)

finds the first element child which is not filtered by the optional node filter

. (void) lastElementChild(node, nodeFilter)

. (void) nextElementSibling(node, nodeFilter)

. (void) previousElementSibling(node, nodeFilter)

. (void) removeAttribute(node, key)

. (void) setAttribute(_node, key, value)

. (void) hasAttribute(node, key)

. (void) setAttributeMap(_node, map)

. (void) width(docElem, value)

. (void) height(docElem, value)

. (void) __append(node, content, append = true)

. (void) replace(node, content)

. (void) prepend(node, content)

. (void) append(node, content)

. (void) getAttribute(node, key)

. (void) remove(_node)

. (void) empty(node)

. (void) hasClass(element, cls)

checks if any of the classes are set

. (void) toggleClass(element, cls)

. (void) setClass(element, cls, on_off)

. (void) setAria(element, attr, value)

. (void) addClass(element, cls)

. (void) removeClass(element, cls)

. (void) getRelativeOffset(node, untilElem = null, ignore_margin = false)

returns the relative position of either the next scrollable parent or positioned parent

. (void) hasAnimatedClone(node)

. (void) initAnimatedClone(node, selector)

if selector is set, watch matched nodes

. (void) syncAnimatedClone(node)

. (void) removeAnimatedClone(node)

. (void) setAbsolutePosition(element, offset)

sets the absolute position of an element

. (void) waitForDOMRemove(_opts)

. (void) waitForDOMInsert(_opts)

. (void) getNode(node)

. (void) printElement(_opts)

small experiment, testing...

. (void) isNode(node, level = 0)

. (void) insertChildAtPosition(node, node_insert, pos)

Inserts the node like array "slice"

. (void) insertBefore(_node, node_before)

. (void) insertAfter(_node, node_after)

. (void) is(node, selector)

. (void) matches(node, selector)

. (void) find(sel)

. (void) matchSelector(docElem, sel, trySelf = false)

. (void) elementsUntil(docElem, selector, untilDocElem)

returns the element matching first the selector upwards, ends at untilDocElem selector & untilDocElem: collect everything until selector matches, but not further than untilDocElem selector: collection eveverything until selector matches, null if no match untilDocElem: stop collecting at docElem

. (void) parent(docElem)

. (void) closest(docElem, selector)

. (void) closestUntil(docElem, selector, untilDocElem)

. (void) parentsUntil(docElem, selector, untilDocElem = document.documentElement)

selector is a stopper (like untiDocElem)

. (void) parents(docElem, selector, untilDocElem = document.documentElement)

selector is a filter

. (void) isInDOM(docElem)

. (void) replaceWith(node, new_node)

new nodes can be node or Array of nodes

. (void) getRect(docElem)

. (void) getComputedStyle(docElem)

. (void) setStyle(docElem, style, append = "px")

. (void) setStyleOne(docElem, key, value)

. (void) setStylePx(docElem, style)

. (void) getRelativePosition(docElem)

. (void) getDimensions(docElem)

. (void) parentsScrollable(node)

returns the scrollable parents

. (void) setDimension(docElem, key, value)

. (void) getDimension(docElem, key)

. (void) prepareSetDimensions(docElem)

. (void) setDimensions(docElem, _dim)

. (void) htmlToNodes(html)

. (void) findTextInNodes(nodes, callback, texts = [])

runs callback on each textnode

. (void) getCSSFloatValue(v)

turns 14.813px into a Number

. (void) isPositioned(docElem)

. (void) isVisible(docElem)

. (void) getBoxSizing(docElem)

. (void) isBorderBox(docElem)

. (void) isContentBox(docElem)

. (void) hideElement(docElem)

. (void) removeChildren(docElem, filter)

remove all children from a DOM node (detach)

. (void) showElement(docElem)

. (void) space(style = null)

. (void) element(tagName, attrs)

. (void) debugRect()

. (void) scrollIntoView(docElem)

. (void) setClassOnMousemove(_opts = {})

. (void) requestFullscreen(elem)

. (void) exitFullscreen()

. (void) fullscreenElement()

. (void) fullscreenEnabled()

. (void) isFullscreen()

. (void) $element(tagName, cls, attrs = {}, no_tables = false)

. (void) div(cls, attrs)

. (void) video(cls, attrs)

. (void) audio(cls, attrs)

. (void) source(cls, attrs)

. (void) span(cls, attrs)

. (void) table(cls, attrs)

. (void) img(cls, attrs)

. (void) tr(cls, attrs)

. (void) th(cls, attrs)

. (void) td(cls, attrs)

. (void) i(cls, attrs)

. (void) p(cls, attrs)

. (void) pre(cls, attrs)

. (void) ul(cls, attrs)

. (void) a(cls, attrs)

. (void) b(cls, attrs)

. (void) li(cls, attrs)

. (void) label(cls, attrs)

. (void) h1(cls, attrs)

. (void) h2(cls, attrs)

. (void) h3(cls, attrs)

. (void) h4(cls, attrs)

. (void) h5(cls, attrs)

. (void) h6(cls, attrs)

. (void) text(text, cls, attrs)

. (void) textEmpty(text)

. (void) table_one_row()

. (void) tr_one_row()

    Quickly fuzzy find classes, mixins, methods, file:

    Control the navigation frame:

    You can focus and blur the search input: