j-templates 7.0.99 → 7.0.100
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/DOM/domNodeConfig.js +14 -12
- package/package.json +1 -1
package/DOM/domNodeConfig.js
CHANGED
|
@@ -174,20 +174,22 @@ exports.DOMNodeConfig = {
|
|
|
174
174
|
let inNextChildren = false;
|
|
175
175
|
for (let x = 0; x < children.length; x++) {
|
|
176
176
|
const nextChild = (lastChild = getHTMLNode(children[x], currentChild));
|
|
177
|
-
if (
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
177
|
+
if (nextChild !== null) {
|
|
178
|
+
if (!currentChild)
|
|
179
|
+
target.appendChild(nextChild);
|
|
180
|
+
else if (nextChild !== currentChild) {
|
|
181
|
+
while (currentChild && (!(inNextChildren = inNextChildren || children.indexOf(currentChild, x + 1) >= 0))) {
|
|
182
|
+
const toRemove = currentChild;
|
|
183
|
+
currentChild = currentChild.nextSibling;
|
|
184
|
+
target.removeChild(toRemove);
|
|
185
|
+
}
|
|
186
|
+
nextChild !== currentChild &&
|
|
187
|
+
target.insertBefore(nextChild, currentChild);
|
|
184
188
|
}
|
|
185
|
-
|
|
186
|
-
|
|
189
|
+
else
|
|
190
|
+
inNextChildren = false;
|
|
191
|
+
currentChild = nextChild.nextSibling;
|
|
187
192
|
}
|
|
188
|
-
else
|
|
189
|
-
inNextChildren = false;
|
|
190
|
-
currentChild = nextChild.nextSibling;
|
|
191
193
|
}
|
|
192
194
|
break;
|
|
193
195
|
}
|