fix node removal regression
This commit is contained in:
parent
9cd7d280dc
commit
3fcd634c44
1 changed files with 3 additions and 2 deletions
|
|
@ -53,9 +53,10 @@ Mithril = m = new function app(window) {
|
|||
cached[cacheCount++] = item
|
||||
}
|
||||
if (!intact) {
|
||||
if (nodes.length < cached.nodes.length) cached.nodes = cached.nodes.filter(function(node) {return node.parentNode !== null})
|
||||
for (var i = 0; i < data.length; i++) if (cached[i] !== undefined) nodes = nodes.concat(cached[i].nodes)
|
||||
for (var i = nodes.length, node; node = cached.nodes[i]; i++) if (node.parentNode !== null) node.parentNode.removeChild(node)
|
||||
for (var i = nodes.length, node; node = cached.nodes[i]; i++) {
|
||||
if (node.parentNode !== null && node.parentNode.childNodes.length != nodes.length) node.parentNode.removeChild(node)
|
||||
}
|
||||
for (var i = cached.nodes.length, node; node = nodes[i]; i++) if (node.parentNode === null) parentElement.appendChild(node)
|
||||
if (data.length < cached.length) cached.length = data.length
|
||||
cached.nodes = nodes
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue