Browse Source

Merge pull request #145 in FUI/fineui from ~GUY/fineui:master to master

* commit '241d7b379cede5f112b5aa710c1bd214bfc3f204':
  update
es6
guy 7 years ago
parent
commit
531f2d1bb0
  1. 36
      bi/core.js
  2. 36
      dist/bundle.js
  3. 6
      dist/bundle.min.js
  4. 36
      dist/core.js
  5. 36
      src/core/wrapper/layout.js

36
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)) {
if (before && children[before.key]) {
var next;
if (isNext) {
next = children[before.key].element.next();
} else {
next = children[before.key].element;
}
if (next.length > 0) {
next.before(children[insert.key].element);
} else {
self._getWrapper().append(children[insert.key].element);
}
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[beforeKey].element.next();
} else {
next = children[beforeKey].element;
}
if (next.length > 0) {
next.before(children[insert].element);
} else {
self._getWrapper().append(children[insert.key].element);
self._getWrapper().append(children[insertKey].element);
}
} else {
throw "key is not defined";
self._getWrapper().append(children[insertKey].element);
}
}

36
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)) {
if (before && children[before.key]) {
var next;
if (isNext) {
next = children[before.key].element.next();
} else {
next = children[before.key].element;
}
if (next.length > 0) {
next.before(children[insert.key].element);
} else {
self._getWrapper().append(children[insert.key].element);
}
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[beforeKey].element.next();
} else {
next = children[beforeKey].element;
}
if (next.length > 0) {
next.before(children[insert].element);
} else {
self._getWrapper().append(children[insert.key].element);
self._getWrapper().append(children[insertKey].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

36
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)) {
if (before && children[before.key]) {
var next;
if (isNext) {
next = children[before.key].element.next();
} else {
next = children[before.key].element;
}
if (next.length > 0) {
next.before(children[insert.key].element);
} else {
self._getWrapper().append(children[insert.key].element);
}
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[beforeKey].element.next();
} else {
next = children[beforeKey].element;
}
if (next.length > 0) {
next.before(children[insert].element);
} else {
self._getWrapper().append(children[insert.key].element);
self._getWrapper().append(children[insertKey].element);
}
} else {
throw "key is not defined";
self._getWrapper().append(children[insertKey].element);
}
}

36
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)) {
if (before && children[before.key]) {
var next;
if (isNext) {
next = children[before.key].element.next();
} else {
next = children[before.key].element;
}
if (next.length > 0) {
next.before(children[insert.key].element);
} else {
self._getWrapper().append(children[insert.key].element);
}
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[beforeKey].element.next();
} else {
next = children[beforeKey].element;
}
if (next.length > 0) {
next.before(children[insert].element);
} else {
self._getWrapper().append(children[insert.key].element);
self._getWrapper().append(children[insertKey].element);
}
} else {
throw "key is not defined";
self._getWrapper().append(children[insertKey].element);
}
}

Loading…
Cancel
Save