Merge branch 'fix-bug-issue424' of https://github.com/ersinfotech/mithril.js into ersinfotech-fix-bug-issue424
Conflicts: mithril.js
This commit is contained in:
commit
fa7e2b4afb
1 changed files with 6 additions and 8 deletions
14
mithril.js
14
mithril.js
|
|
@ -133,7 +133,7 @@ var m = (function app(window, undefined) {
|
|||
for (var i = 0; i < cached.length; i++) {
|
||||
if (cached[i] && cached[i].attrs && cached[i].attrs.key != null) {
|
||||
shouldMaintainIdentities = true;
|
||||
existing[cached[i].attrs.key] = {action: DELETION, index: i, element: cached[i].nodes[0]}
|
||||
existing[cached[i].attrs.key] = {action: DELETION, index: i}
|
||||
}
|
||||
}
|
||||
if (shouldMaintainIdentities) {
|
||||
|
|
@ -154,13 +154,11 @@ var m = (function app(window, undefined) {
|
|||
if (data[i].attrs.key != null) {
|
||||
var key = data[i].attrs.key;
|
||||
if (!existing[key]) existing[key] = {action: INSERTION, index: i};
|
||||
else {
|
||||
existing[key] = {
|
||||
action: MOVE,
|
||||
index: i,
|
||||
from: existing[key].index,
|
||||
element: existing[key].element || $document.createElement("div")
|
||||
}
|
||||
else existing[key] = {
|
||||
action: MOVE,
|
||||
index: i,
|
||||
from: existing[key].index,
|
||||
element: cached.nodes[existing[key].index] || $document.createElement("div")
|
||||
}
|
||||
}
|
||||
else unkeyed.push({index: i, element: parentElement.childNodes[i] || $document.createElement("div")})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue