MCPcopy
hub / github.com/MithrilJS/mithril.js / toFragment

Function toFragment

render/render.js:583–595  ·  view source on GitHub ↗
(vnode)

Source from the content-addressed store, hash-verified

581 }
582
583 function toFragment(vnode) {
584 var count = vnode.domSize
585 if (count != null || vnode.dom == null) {
586 var fragment = $doc.createDocumentFragment()
587 if (count > 0) {
588 var dom = vnode.dom
589 while (--count) fragment.appendChild(dom.nextSibling)
590 fragment.insertBefore(dom, fragment.firstChild)
591 }
592 return fragment
593 }
594 else return vnode.dom
595 }
596 function getNextSibling(vnodes, i, nextSibling) {
597 for (; i < vnodes.length; i++) {
598 if (vnodes[i] != null && vnodes[i].dom != null) return vnodes[i].dom

Callers 2

updateNodesFunction · 0.70
updateHTMLFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected