MCPcopy
hub / github.com/bigskysoftware/htmx / make

Function make

test/util/util.js:7–31  ·  view source on GitHub ↗
(htmlStr)

Source from the content-addressed store, hash-verified

5}
6
7function make(htmlStr) {
8 htmlStr = htmlStr.trim()
9 var makeFn = function() {
10 var range = document.createRange()
11 var fragment = range.createContextualFragment(htmlStr)
12 var wa = getWorkArea()
13 var child = null
14 var children = fragment.children || fragment.childNodes // IE
15 var appendedChildren = []
16 while (children.length > 0) {
17 child = children[0]
18 wa.appendChild(child)
19 appendedChildren.push(child)
20 }
21 for (var i = 0; i < appendedChildren.length; i++) {
22 htmx.process(appendedChildren[i])
23 }
24 return child // return last added element
25 }
26 if (getWorkArea()) {
27 return makeFn()
28 } else {
29 ready(makeFn)
30 }
31}
32
33function ready(fn) {
34 if (document.readyState !== 'loading') {

Callers 15

hx-headers.jsFile · 0.50
hx-select-oob.jsFile · 0.50
hx-trigger.jsFile · 0.50
hx-indicator.jsFile · 0.50
hx-history-elt.jsFile · 0.50
hx-put.jsFile · 0.50
hx-boost.jsFile · 0.50
hx-replace-url.jsFile · 0.50
hx-post.jsFile · 0.50
hx-sync.jsFile · 0.50
hx-confirm.jsFile · 0.50
hx-delete.jsFile · 0.50

Calls 3

getWorkAreaFunction · 0.70
makeFnFunction · 0.70
readyFunction · 0.70

Tested by

no test coverage detected