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

Function makeFn

test/util/util.js:9–25  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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 {

Callers 1

makeFunction · 0.70

Calls 1

getWorkAreaFunction · 0.70

Tested by

no test coverage detected