Skip to content

Commit

Permalink
new test ver
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelWest22 authored Dec 9, 2024
1 parent 3117fec commit acdd51b
Showing 1 changed file with 9 additions and 19 deletions.
28 changes: 9 additions & 19 deletions docs/htmx-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -622,28 +622,17 @@ var htmx = (function() {
}
}

var templates = fragment.querySelectorAll('template');
var el, template, attribs, attrib, count, child, content;
for (var i=0; i<templates.length; i++) {
el = templates[i];
var child
forEach(fragment.querySelectorAll('template'), function(el) {
if (!el.content) {
template = el.ownerDocument.createElement('template');
el.parentNode.insertBefore(template, el);
attribs = el.attributes;
count = attribs.length;
while (count-- > 0) {
attrib = attribs[count];
template.setAttribute(attrib.name, attrib.value);
el.removeAttribute(attrib.name);
}
el.parentNode.removeChild(el);
content = template.content;

const template = el.ownerDocument.createElement('template')
el.parentNode.insertBefore(template, el)
el.parentNode.removeChild(el)
while ((child = el.firstChild)) {
content.appendChild(child);
template.content.appendChild(child)
}
}
}
})
return fragment
}

Expand Down Expand Up @@ -5231,4 +5220,5 @@ var htmx = (function() {
* @property {(swapStyle: HtmxSwapStyle, target: Node, fragment: Node, settleInfo: HtmxSettleInfo) => boolean|Node[]} handleSwap
* @property {(xhr: XMLHttpRequest, parameters: FormData, elt: Node) => *|string|null} encodeParameters
* @property {() => string[]|null} getSelectors
*/
*/

0 comments on commit acdd51b

Please sign in to comment.