j-templates 7.0.11 → 7.0.13
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 +2 -2
- package/Node/vNode.js +4 -3
- package/package.json +1 -1
package/DOM/domNodeConfig.js
CHANGED
|
@@ -144,7 +144,7 @@ exports.DOMNodeConfig = {
|
|
|
144
144
|
reconcileChildren(target, children) {
|
|
145
145
|
if (!target.firstChild) {
|
|
146
146
|
for (let x = 0; x < children.length; x++)
|
|
147
|
-
target.
|
|
147
|
+
target.appendChild(children[x]);
|
|
148
148
|
return;
|
|
149
149
|
}
|
|
150
150
|
if (children.length === 0) {
|
|
@@ -173,6 +173,6 @@ exports.DOMNodeConfig = {
|
|
|
173
173
|
while (target.lastChild !== children[x - 1])
|
|
174
174
|
target.removeChild(target.lastChild);
|
|
175
175
|
for (; x < children.length; x++)
|
|
176
|
-
target.
|
|
176
|
+
target.appendChild(children[x]);
|
|
177
177
|
}
|
|
178
178
|
};
|
package/Node/vNode.js
CHANGED
|
@@ -129,6 +129,7 @@ function InitNode(vnode) {
|
|
|
129
129
|
}
|
|
130
130
|
else if (childrenArray) {
|
|
131
131
|
vnode.children = childrenArray;
|
|
132
|
+
vNode.InitAll(vnode.children);
|
|
132
133
|
}
|
|
133
134
|
else if (children) {
|
|
134
135
|
if (data) {
|
|
@@ -137,7 +138,7 @@ function InitNode(vnode) {
|
|
|
137
138
|
else
|
|
138
139
|
StaticChildren(vnode, children);
|
|
139
140
|
}
|
|
140
|
-
UpdateChildren(vnode, true);
|
|
141
|
+
UpdateChildren(vnode, true, !!childrenArray);
|
|
141
142
|
}
|
|
142
143
|
function StaticChildren(vnode, children) {
|
|
143
144
|
const childrenScope = Store_1.ObservableScope.Create(WrapStaticChildren(vnode.injector, children));
|
|
@@ -256,14 +257,14 @@ function WrapDynamicChildren(dataScope, nodeList, injector, children) {
|
|
|
256
257
|
return nextNodeArray;
|
|
257
258
|
};
|
|
258
259
|
}
|
|
259
|
-
function UpdateChildren(vnode, init = false) {
|
|
260
|
+
function UpdateChildren(vnode, init = false, skipInit = false) {
|
|
260
261
|
if (!vnode.children)
|
|
261
262
|
return;
|
|
262
263
|
const children = vnode.children;
|
|
263
264
|
(0, thread_1.Thread)(function () {
|
|
264
265
|
if (vnode.destroyed || children !== vnode.children)
|
|
265
266
|
return;
|
|
266
|
-
for (let x = 0; x < children.length; x++)
|
|
267
|
+
for (let x = 0; !skipInit && x < children.length; x++)
|
|
267
268
|
if (children[x].node === null) {
|
|
268
269
|
const childNode = children[x];
|
|
269
270
|
(0, thread_1.Schedule)(function () {
|