|
|
|
@ -11580,27 +11580,9 @@ BI.Layout = BI.inherit(BI.Widget, {
|
|
|
|
|
oldEndVnode = oldCh[--oldEndIdx]; |
|
|
|
|
newStartVnode = newCh[++newStartIdx]; |
|
|
|
|
} else { |
|
|
|
|
if (oldKeyToIdx === undefined) { |
|
|
|
|
oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx); |
|
|
|
|
} |
|
|
|
|
idxInOld = oldKeyToIdx[newStartVnode.key]; |
|
|
|
|
if (BI.isNull(idxInOld)) { |
|
|
|
|
var node = addNode(newStartVnode); |
|
|
|
|
insertBefore(node, oldStartVnode); |
|
|
|
|
newStartVnode = newCh[++newStartIdx]; |
|
|
|
|
} else { |
|
|
|
|
elmToMove = oldCh[idxInOld]; |
|
|
|
|
var node = addNode(newStartVnode); |
|
|
|
|
insertBefore(node, oldStartVnode); |
|
|
|
|
// if (elmToMove.sel !== newStartVnode.sel) {
|
|
|
|
|
// api.insertBefore(parentElm, createElm(newStartVnode), oldStartVnode.elm);
|
|
|
|
|
// } else {
|
|
|
|
|
// updated = this.patchItem(elmToMove, newStartVnode, idxInOld) || updated;
|
|
|
|
|
// oldCh[idxInOld] = undefined;
|
|
|
|
|
// api.insertBefore(parentElm, (elmToMove.elm), oldStartVnode.elm);
|
|
|
|
|
// }
|
|
|
|
|
newStartVnode = newCh[++newStartIdx]; |
|
|
|
|
} |
|
|
|
|
var node = addNode(newStartVnode); |
|
|
|
|
insertBefore(node, oldStartVnode); |
|
|
|
|
newStartVnode = newCh[++newStartIdx]; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (oldStartIdx > oldEndIdx) { |
|
|
|
@ -11673,15 +11655,6 @@ BI.Layout = BI.inherit(BI.Widget, {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function createKeyToOldIdx(children, beginIdx, endIdx) { |
|
|
|
|
var i, map = {}, key; |
|
|
|
|
for (i = beginIdx; i <= endIdx; ++i) { |
|
|
|
|
key = children[i].key; |
|
|
|
|
if (key !== undefined) map[key] = i; |
|
|
|
|
} |
|
|
|
|
return map; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return updated; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|