Skip to content
Snippets Groups Projects
Commit 6ee1c646 authored by Greg Fodor's avatar Greg Fodor
Browse files

Fix variable bindings for inner loops which led to infinite loop

parent 49b78136
No related branches found
No related tags found
No related merge requests found
...@@ -95,17 +95,17 @@ function attachTemplate(templateEl) { ...@@ -95,17 +95,17 @@ function attachTemplate(templateEl) {
const templateRoot = clone.firstElementChild; const templateRoot = clone.firstElementChild;
const templateRootAttrs = templateRoot.attributes; const templateRootAttrs = templateRoot.attributes;
for (var i = 0; i < targetEls.length; i++) { for (let i = 0; i < targetEls.length; i++) {
const targetEl = targetEls[i]; const targetEl = targetEls[i];
// Merge root element attributes with the target element // Merge root element attributes with the target element
for (var i = 0; i < templateRootAttrs.length; i++) { for (let j = 0; j < templateRootAttrs.length; j++) {
targetEl.setAttribute(templateRootAttrs[i].name, templateRootAttrs[i].value); targetEl.setAttribute(templateRootAttrs[j].name, templateRootAttrs[j].value);
} }
// Append all child elements // Append all child elements
for (var i = 0; i < templateRoot.children.length; i++) { for (let j = 0; j < templateRoot.children.length; j++) {
targetEl.appendChild(document.importNode(templateRoot.children[i], true)); targetEl.appendChild(document.importNode(templateRoot.children[j], true));
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment