guy 7 years ago
parent
commit
a0e0aff7f7
  1. 24
      bi/core.js
  2. 24
      dist/bundle.js
  3. 6
      dist/bundle.min.js
  4. 24
      dist/core.js
  5. 24
      src/core/wrapper/layout.js

24
bi/core.js

@ -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);
}
}

24
dist/bundle.js vendored

@ -19902,9 +19902,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 = {};
@ -19956,6 +19953,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];
});
@ -19979,7 +19977,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);
}
}
@ -19991,27 +19989,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);
}
}

6
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

24
dist/core.js vendored

@ -19851,9 +19851,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 = {};
@ -19905,6 +19902,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];
});
@ -19928,7 +19926,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);
}
}
@ -19940,27 +19938,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);
}
}

24
src/core/wrapper/layout.js

@ -362,9 +362,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 = {};
@ -416,6 +413,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];
});
@ -439,7 +437,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);
}
}
@ -451,27 +449,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);
}
}

Loading…
Cancel
Save