|
|
|
@ -11546,9 +11546,6 @@ BI.Layout = BI.inherit(BI.Widget, {
|
|
|
|
|
var newEndIdx = newCh.length - 1; |
|
|
|
|
var newStartVnode = newCh[0]; |
|
|
|
|
var newEndVnode = newCh[newEndIdx]; |
|
|
|
|
var oldKeyToIdx; |
|
|
|
|
var idxInOld; |
|
|
|
|
var elmToMove; |
|
|
|
|
var before; |
|
|
|
|
var updated; |
|
|
|
|
var children = {}; |
|
|
|
@ -11600,6 +11597,7 @@ BI.Layout = BI.inherit(BI.Widget, {
|
|
|
|
|
BI.each(newCh, function (i, child) { |
|
|
|
|
var node = self._getOptions(child); |
|
|
|
|
var key = node.key == null ? i : node.key; |
|
|
|
|
children[key]._mount(); |
|
|
|
|
self._children[self._getChildName(i)] = children[key]; |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
@ -11623,7 +11621,7 @@ BI.Layout = BI.inherit(BI.Widget, {
|
|
|
|
|
function addVnodes(before, vnodes, startIdx, endIdx) { |
|
|
|
|
for (; startIdx <= endIdx; ++startIdx) { |
|
|
|
|
var node = addNode(vnodes[startIdx], startIdx); |
|
|
|
|
insertBefore(node, before); |
|
|
|
|
insertBefore(node, before, false, startIdx); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -11635,27 +11633,25 @@ BI.Layout = BI.inherit(BI.Widget, {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function insertBefore(insert, before, isNext) { |
|
|
|
|
function insertBefore(insert, before, isNext, index) { |
|
|
|
|
insert = self._getOptions(insert); |
|
|
|
|
before = before && self._getOptions(before); |
|
|
|
|
if (BI.isKey(insert.key)) { |
|
|
|
|
var insertKey = BI.isKey(insert.key) ? insert.key : index; |
|
|
|
|
if (before && children[before.key]) { |
|
|
|
|
var beforeKey = BI.isKey(before.key) ? before.key : index; |
|
|
|
|
var next; |
|
|
|
|
if (isNext) { |
|
|
|
|
next = children[before.key].element.next(); |
|
|
|
|
next = children[beforeKey].element.next(); |
|
|
|
|
} else { |
|
|
|
|
next = children[before.key].element; |
|
|
|
|
next = children[beforeKey].element; |
|
|
|
|
} |
|
|
|
|
if (next.length > 0) { |
|
|
|
|
next.before(children[insert.key].element); |
|
|
|
|
next.before(children[insert].element); |
|
|
|
|
} else { |
|
|
|
|
self._getWrapper().append(children[insert.key].element); |
|
|
|
|
self._getWrapper().append(children[insertKey].element); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
self._getWrapper().append(children[insert.key].element); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
throw "key is not defined"; |
|
|
|
|
self._getWrapper().append(children[insertKey].element); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|