Browse Source

Merge pull request #876 in VISUAL/fineui from ~GUY/fineui:master to master

* commit 'cb4808861a774b2019c9f3114518fa93cefde04b':
  context
es6
guy 6 years ago
parent
commit
efc5740e88
  1. 18
      dist/2.0/fineui.ie.js
  2. 10
      dist/2.0/fineui.ie.min.js
  3. 18
      dist/2.0/fineui.js
  4. 10
      dist/2.0/fineui.min.js
  5. 6
      dist/base.js
  6. 18
      dist/bundle.ie.js
  7. 10
      dist/bundle.ie.min.js
  8. 18
      dist/bundle.js
  9. 10
      dist/bundle.min.js
  10. 12
      dist/core.js
  11. 18
      dist/fineui.ie.js
  12. 10
      dist/fineui.ie.min.js
  13. 18
      dist/fineui.js
  14. 10
      dist/fineui.min.js
  15. 18
      dist/fineui_without_jquery_polyfill.js
  16. 2
      dist/utils.min.js
  17. 2
      src/base/list/listview.js
  18. 4
      src/base/list/virtuallist.js
  19. 12
      src/core/wrapper/layout.js

18
dist/2.0/fineui.ie.js vendored

@ -14842,10 +14842,10 @@ BI.Layout = BI.inherit(BI.Widget, {
return index + "";
},
_addElement: function (i, item) {
_addElement: function (i, item, context) {
var self = this, w;
if (!this.hasWidget(this._getChildName(i))) {
w = BI.createWidget(item);
w = BI.createWidget(item, context);
w.on(BI.Events.DESTROY, function () {
BI.each(self._children, function (name, child) {
if (child === w) {
@ -15052,12 +15052,12 @@ BI.Layout = BI.inherit(BI.Widget, {
w._mount();
},
addItems: function (items) {
addItems: function (items, context) {
var self = this, o = this.options;
var fragment = BI.Widget._renderEngine.createFragment();
var added = [];
BI.each(items, function (i, item) {
var w = self._addElement(o.items.length, item);
var w = self._addElement(o.items.length, item, context);
self._children[self._getChildName(o.items.length)] = w;
o.items.push(item);
added.push(w);
@ -15071,14 +15071,14 @@ BI.Layout = BI.inherit(BI.Widget, {
}
},
prependItems: function (items) {
prependItems: function (items, context) {
var self = this;
items = items || [];
var fragment = BI.Widget._renderEngine.createFragment();
var added = [];
for (var i = items.length - 1; i >= 0; i--) {
this._addItemAt(0, items[i]);
var w = this._addElement(0, items[i]);
var w = this._addElement(0, items[i], context);
self._children[self._getChildName(0)] = w;
this.options.items.unshift(items[i]);
added.push(w);
@ -41752,7 +41752,7 @@ BI.ListView = BI.inherit(BI.Widget, {
};
while ((lastHeight = getElementHeight()) < minContentHeight && index < o.items.length) {
var items = o.items.slice(index, index + o.blockSize);
this.container.addItems(items);
this.container.addItems(items, this);
var addedHeight = getElementHeight() - lastHeight;
this.cache[cnt] = {
index: index,
@ -41871,7 +41871,7 @@ BI.VirtualList = BI.inherit(BI.Widget, {
};
while ((lastHeight = getElementHeight()) < minContentHeight && index < o.items.length) {
var items = o.items.slice(index, index + o.blockSize);
this.container.addItems(items);
this.container.addItems(items, this);
var addedHeight = getElementHeight() - lastHeight;
this.cache[cnt] = {
index: index,
@ -41923,7 +41923,7 @@ BI.VirtualList = BI.inherit(BI.Widget, {
}
if (this.cache[i].destroyed === true) {
for (var j = index; j < index + o.blockSize && j < o.items.length; j++) {
var w = this.container._addElement(j, BI.extend({root: true}, BI.stripEL(o.items[j])));
var w = this.container._addElement(j, BI.extend({root: true}, BI.stripEL(o.items[j])), this);
currentFragment.appendChild(w.element[0]);
}
this.cache[i].destroyed = false;

10
dist/2.0/fineui.ie.min.js vendored

File diff suppressed because one or more lines are too long

18
dist/2.0/fineui.js vendored

@ -14842,10 +14842,10 @@ BI.Layout = BI.inherit(BI.Widget, {
return index + "";
},
_addElement: function (i, item) {
_addElement: function (i, item, context) {
var self = this, w;
if (!this.hasWidget(this._getChildName(i))) {
w = BI.createWidget(item);
w = BI.createWidget(item, context);
w.on(BI.Events.DESTROY, function () {
BI.each(self._children, function (name, child) {
if (child === w) {
@ -15052,12 +15052,12 @@ BI.Layout = BI.inherit(BI.Widget, {
w._mount();
},
addItems: function (items) {
addItems: function (items, context) {
var self = this, o = this.options;
var fragment = BI.Widget._renderEngine.createFragment();
var added = [];
BI.each(items, function (i, item) {
var w = self._addElement(o.items.length, item);
var w = self._addElement(o.items.length, item, context);
self._children[self._getChildName(o.items.length)] = w;
o.items.push(item);
added.push(w);
@ -15071,14 +15071,14 @@ BI.Layout = BI.inherit(BI.Widget, {
}
},
prependItems: function (items) {
prependItems: function (items, context) {
var self = this;
items = items || [];
var fragment = BI.Widget._renderEngine.createFragment();
var added = [];
for (var i = items.length - 1; i >= 0; i--) {
this._addItemAt(0, items[i]);
var w = this._addElement(0, items[i]);
var w = this._addElement(0, items[i], context);
self._children[self._getChildName(0)] = w;
this.options.items.unshift(items[i]);
added.push(w);
@ -42156,7 +42156,7 @@ BI.ListView = BI.inherit(BI.Widget, {
};
while ((lastHeight = getElementHeight()) < minContentHeight && index < o.items.length) {
var items = o.items.slice(index, index + o.blockSize);
this.container.addItems(items);
this.container.addItems(items, this);
var addedHeight = getElementHeight() - lastHeight;
this.cache[cnt] = {
index: index,
@ -42275,7 +42275,7 @@ BI.VirtualList = BI.inherit(BI.Widget, {
};
while ((lastHeight = getElementHeight()) < minContentHeight && index < o.items.length) {
var items = o.items.slice(index, index + o.blockSize);
this.container.addItems(items);
this.container.addItems(items, this);
var addedHeight = getElementHeight() - lastHeight;
this.cache[cnt] = {
index: index,
@ -42327,7 +42327,7 @@ BI.VirtualList = BI.inherit(BI.Widget, {
}
if (this.cache[i].destroyed === true) {
for (var j = index; j < index + o.blockSize && j < o.items.length; j++) {
var w = this.container._addElement(j, BI.extend({root: true}, BI.stripEL(o.items[j])));
var w = this.container._addElement(j, BI.extend({root: true}, BI.stripEL(o.items[j])), this);
currentFragment.appendChild(w.element[0]);
}
this.cache[i].destroyed = false;

10
dist/2.0/fineui.min.js vendored

File diff suppressed because one or more lines are too long

6
dist/base.js vendored

@ -6367,7 +6367,7 @@ BI.ListView = BI.inherit(BI.Widget, {
};
while ((lastHeight = getElementHeight()) < minContentHeight && index < o.items.length) {
var items = o.items.slice(index, index + o.blockSize);
this.container.addItems(items);
this.container.addItems(items, this);
var addedHeight = getElementHeight() - lastHeight;
this.cache[cnt] = {
index: index,
@ -6486,7 +6486,7 @@ BI.VirtualList = BI.inherit(BI.Widget, {
};
while ((lastHeight = getElementHeight()) < minContentHeight && index < o.items.length) {
var items = o.items.slice(index, index + o.blockSize);
this.container.addItems(items);
this.container.addItems(items, this);
var addedHeight = getElementHeight() - lastHeight;
this.cache[cnt] = {
index: index,
@ -6538,7 +6538,7 @@ BI.VirtualList = BI.inherit(BI.Widget, {
}
if (this.cache[i].destroyed === true) {
for (var j = index; j < index + o.blockSize && j < o.items.length; j++) {
var w = this.container._addElement(j, BI.extend({root: true}, BI.stripEL(o.items[j])));
var w = this.container._addElement(j, BI.extend({root: true}, BI.stripEL(o.items[j])), this);
currentFragment.appendChild(w.element[0]);
}
this.cache[i].destroyed = false;

18
dist/bundle.ie.js vendored

@ -14842,10 +14842,10 @@ BI.Layout = BI.inherit(BI.Widget, {
return index + "";
},
_addElement: function (i, item) {
_addElement: function (i, item, context) {
var self = this, w;
if (!this.hasWidget(this._getChildName(i))) {
w = BI.createWidget(item);
w = BI.createWidget(item, context);
w.on(BI.Events.DESTROY, function () {
BI.each(self._children, function (name, child) {
if (child === w) {
@ -15052,12 +15052,12 @@ BI.Layout = BI.inherit(BI.Widget, {
w._mount();
},
addItems: function (items) {
addItems: function (items, context) {
var self = this, o = this.options;
var fragment = BI.Widget._renderEngine.createFragment();
var added = [];
BI.each(items, function (i, item) {
var w = self._addElement(o.items.length, item);
var w = self._addElement(o.items.length, item, context);
self._children[self._getChildName(o.items.length)] = w;
o.items.push(item);
added.push(w);
@ -15071,14 +15071,14 @@ BI.Layout = BI.inherit(BI.Widget, {
}
},
prependItems: function (items) {
prependItems: function (items, context) {
var self = this;
items = items || [];
var fragment = BI.Widget._renderEngine.createFragment();
var added = [];
for (var i = items.length - 1; i >= 0; i--) {
this._addItemAt(0, items[i]);
var w = this._addElement(0, items[i]);
var w = this._addElement(0, items[i], context);
self._children[self._getChildName(0)] = w;
this.options.items.unshift(items[i]);
added.push(w);
@ -41752,7 +41752,7 @@ BI.ListView = BI.inherit(BI.Widget, {
};
while ((lastHeight = getElementHeight()) < minContentHeight && index < o.items.length) {
var items = o.items.slice(index, index + o.blockSize);
this.container.addItems(items);
this.container.addItems(items, this);
var addedHeight = getElementHeight() - lastHeight;
this.cache[cnt] = {
index: index,
@ -41871,7 +41871,7 @@ BI.VirtualList = BI.inherit(BI.Widget, {
};
while ((lastHeight = getElementHeight()) < minContentHeight && index < o.items.length) {
var items = o.items.slice(index, index + o.blockSize);
this.container.addItems(items);
this.container.addItems(items, this);
var addedHeight = getElementHeight() - lastHeight;
this.cache[cnt] = {
index: index,
@ -41923,7 +41923,7 @@ BI.VirtualList = BI.inherit(BI.Widget, {
}
if (this.cache[i].destroyed === true) {
for (var j = index; j < index + o.blockSize && j < o.items.length; j++) {
var w = this.container._addElement(j, BI.extend({root: true}, BI.stripEL(o.items[j])));
var w = this.container._addElement(j, BI.extend({root: true}, BI.stripEL(o.items[j])), this);
currentFragment.appendChild(w.element[0]);
}
this.cache[i].destroyed = false;

10
dist/bundle.ie.min.js vendored

File diff suppressed because one or more lines are too long

18
dist/bundle.js vendored

@ -14842,10 +14842,10 @@ BI.Layout = BI.inherit(BI.Widget, {
return index + "";
},
_addElement: function (i, item) {
_addElement: function (i, item, context) {
var self = this, w;
if (!this.hasWidget(this._getChildName(i))) {
w = BI.createWidget(item);
w = BI.createWidget(item, context);
w.on(BI.Events.DESTROY, function () {
BI.each(self._children, function (name, child) {
if (child === w) {
@ -15052,12 +15052,12 @@ BI.Layout = BI.inherit(BI.Widget, {
w._mount();
},
addItems: function (items) {
addItems: function (items, context) {
var self = this, o = this.options;
var fragment = BI.Widget._renderEngine.createFragment();
var added = [];
BI.each(items, function (i, item) {
var w = self._addElement(o.items.length, item);
var w = self._addElement(o.items.length, item, context);
self._children[self._getChildName(o.items.length)] = w;
o.items.push(item);
added.push(w);
@ -15071,14 +15071,14 @@ BI.Layout = BI.inherit(BI.Widget, {
}
},
prependItems: function (items) {
prependItems: function (items, context) {
var self = this;
items = items || [];
var fragment = BI.Widget._renderEngine.createFragment();
var added = [];
for (var i = items.length - 1; i >= 0; i--) {
this._addItemAt(0, items[i]);
var w = this._addElement(0, items[i]);
var w = this._addElement(0, items[i], context);
self._children[self._getChildName(0)] = w;
this.options.items.unshift(items[i]);
added.push(w);
@ -42156,7 +42156,7 @@ BI.ListView = BI.inherit(BI.Widget, {
};
while ((lastHeight = getElementHeight()) < minContentHeight && index < o.items.length) {
var items = o.items.slice(index, index + o.blockSize);
this.container.addItems(items);
this.container.addItems(items, this);
var addedHeight = getElementHeight() - lastHeight;
this.cache[cnt] = {
index: index,
@ -42275,7 +42275,7 @@ BI.VirtualList = BI.inherit(BI.Widget, {
};
while ((lastHeight = getElementHeight()) < minContentHeight && index < o.items.length) {
var items = o.items.slice(index, index + o.blockSize);
this.container.addItems(items);
this.container.addItems(items, this);
var addedHeight = getElementHeight() - lastHeight;
this.cache[cnt] = {
index: index,
@ -42327,7 +42327,7 @@ BI.VirtualList = BI.inherit(BI.Widget, {
}
if (this.cache[i].destroyed === true) {
for (var j = index; j < index + o.blockSize && j < o.items.length; j++) {
var w = this.container._addElement(j, BI.extend({root: true}, BI.stripEL(o.items[j])));
var w = this.container._addElement(j, BI.extend({root: true}, BI.stripEL(o.items[j])), this);
currentFragment.appendChild(w.element[0]);
}
this.cache[i].destroyed = false;

10
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

12
dist/core.js vendored

@ -14842,10 +14842,10 @@ BI.Layout = BI.inherit(BI.Widget, {
return index + "";
},
_addElement: function (i, item) {
_addElement: function (i, item, context) {
var self = this, w;
if (!this.hasWidget(this._getChildName(i))) {
w = BI.createWidget(item);
w = BI.createWidget(item, context);
w.on(BI.Events.DESTROY, function () {
BI.each(self._children, function (name, child) {
if (child === w) {
@ -15052,12 +15052,12 @@ BI.Layout = BI.inherit(BI.Widget, {
w._mount();
},
addItems: function (items) {
addItems: function (items, context) {
var self = this, o = this.options;
var fragment = BI.Widget._renderEngine.createFragment();
var added = [];
BI.each(items, function (i, item) {
var w = self._addElement(o.items.length, item);
var w = self._addElement(o.items.length, item, context);
self._children[self._getChildName(o.items.length)] = w;
o.items.push(item);
added.push(w);
@ -15071,14 +15071,14 @@ BI.Layout = BI.inherit(BI.Widget, {
}
},
prependItems: function (items) {
prependItems: function (items, context) {
var self = this;
items = items || [];
var fragment = BI.Widget._renderEngine.createFragment();
var added = [];
for (var i = items.length - 1; i >= 0; i--) {
this._addItemAt(0, items[i]);
var w = this._addElement(0, items[i]);
var w = this._addElement(0, items[i], context);
self._children[self._getChildName(0)] = w;
this.options.items.unshift(items[i]);
added.push(w);

18
dist/fineui.ie.js vendored

@ -15087,10 +15087,10 @@ BI.Layout = BI.inherit(BI.Widget, {
return index + "";
},
_addElement: function (i, item) {
_addElement: function (i, item, context) {
var self = this, w;
if (!this.hasWidget(this._getChildName(i))) {
w = BI.createWidget(item);
w = BI.createWidget(item, context);
w.on(BI.Events.DESTROY, function () {
BI.each(self._children, function (name, child) {
if (child === w) {
@ -15297,12 +15297,12 @@ BI.Layout = BI.inherit(BI.Widget, {
w._mount();
},
addItems: function (items) {
addItems: function (items, context) {
var self = this, o = this.options;
var fragment = BI.Widget._renderEngine.createFragment();
var added = [];
BI.each(items, function (i, item) {
var w = self._addElement(o.items.length, item);
var w = self._addElement(o.items.length, item, context);
self._children[self._getChildName(o.items.length)] = w;
o.items.push(item);
added.push(w);
@ -15316,14 +15316,14 @@ BI.Layout = BI.inherit(BI.Widget, {
}
},
prependItems: function (items) {
prependItems: function (items, context) {
var self = this;
items = items || [];
var fragment = BI.Widget._renderEngine.createFragment();
var added = [];
for (var i = items.length - 1; i >= 0; i--) {
this._addItemAt(0, items[i]);
var w = this._addElement(0, items[i]);
var w = this._addElement(0, items[i], context);
self._children[self._getChildName(0)] = w;
this.options.items.unshift(items[i]);
added.push(w);
@ -41997,7 +41997,7 @@ BI.ListView = BI.inherit(BI.Widget, {
};
while ((lastHeight = getElementHeight()) < minContentHeight && index < o.items.length) {
var items = o.items.slice(index, index + o.blockSize);
this.container.addItems(items);
this.container.addItems(items, this);
var addedHeight = getElementHeight() - lastHeight;
this.cache[cnt] = {
index: index,
@ -42116,7 +42116,7 @@ BI.VirtualList = BI.inherit(BI.Widget, {
};
while ((lastHeight = getElementHeight()) < minContentHeight && index < o.items.length) {
var items = o.items.slice(index, index + o.blockSize);
this.container.addItems(items);
this.container.addItems(items, this);
var addedHeight = getElementHeight() - lastHeight;
this.cache[cnt] = {
index: index,
@ -42168,7 +42168,7 @@ BI.VirtualList = BI.inherit(BI.Widget, {
}
if (this.cache[i].destroyed === true) {
for (var j = index; j < index + o.blockSize && j < o.items.length; j++) {
var w = this.container._addElement(j, BI.extend({root: true}, BI.stripEL(o.items[j])));
var w = this.container._addElement(j, BI.extend({root: true}, BI.stripEL(o.items[j])), this);
currentFragment.appendChild(w.element[0]);
}
this.cache[i].destroyed = false;

10
dist/fineui.ie.min.js vendored

File diff suppressed because one or more lines are too long

18
dist/fineui.js vendored

@ -15087,10 +15087,10 @@ BI.Layout = BI.inherit(BI.Widget, {
return index + "";
},
_addElement: function (i, item) {
_addElement: function (i, item, context) {
var self = this, w;
if (!this.hasWidget(this._getChildName(i))) {
w = BI.createWidget(item);
w = BI.createWidget(item, context);
w.on(BI.Events.DESTROY, function () {
BI.each(self._children, function (name, child) {
if (child === w) {
@ -15297,12 +15297,12 @@ BI.Layout = BI.inherit(BI.Widget, {
w._mount();
},
addItems: function (items) {
addItems: function (items, context) {
var self = this, o = this.options;
var fragment = BI.Widget._renderEngine.createFragment();
var added = [];
BI.each(items, function (i, item) {
var w = self._addElement(o.items.length, item);
var w = self._addElement(o.items.length, item, context);
self._children[self._getChildName(o.items.length)] = w;
o.items.push(item);
added.push(w);
@ -15316,14 +15316,14 @@ BI.Layout = BI.inherit(BI.Widget, {
}
},
prependItems: function (items) {
prependItems: function (items, context) {
var self = this;
items = items || [];
var fragment = BI.Widget._renderEngine.createFragment();
var added = [];
for (var i = items.length - 1; i >= 0; i--) {
this._addItemAt(0, items[i]);
var w = this._addElement(0, items[i]);
var w = this._addElement(0, items[i], context);
self._children[self._getChildName(0)] = w;
this.options.items.unshift(items[i]);
added.push(w);
@ -42401,7 +42401,7 @@ BI.ListView = BI.inherit(BI.Widget, {
};
while ((lastHeight = getElementHeight()) < minContentHeight && index < o.items.length) {
var items = o.items.slice(index, index + o.blockSize);
this.container.addItems(items);
this.container.addItems(items, this);
var addedHeight = getElementHeight() - lastHeight;
this.cache[cnt] = {
index: index,
@ -42520,7 +42520,7 @@ BI.VirtualList = BI.inherit(BI.Widget, {
};
while ((lastHeight = getElementHeight()) < minContentHeight && index < o.items.length) {
var items = o.items.slice(index, index + o.blockSize);
this.container.addItems(items);
this.container.addItems(items, this);
var addedHeight = getElementHeight() - lastHeight;
this.cache[cnt] = {
index: index,
@ -42572,7 +42572,7 @@ BI.VirtualList = BI.inherit(BI.Widget, {
}
if (this.cache[i].destroyed === true) {
for (var j = index; j < index + o.blockSize && j < o.items.length; j++) {
var w = this.container._addElement(j, BI.extend({root: true}, BI.stripEL(o.items[j])));
var w = this.container._addElement(j, BI.extend({root: true}, BI.stripEL(o.items[j])), this);
currentFragment.appendChild(w.element[0]);
}
this.cache[i].destroyed = false;

10
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

18
dist/fineui_without_jquery_polyfill.js vendored

@ -14588,10 +14588,10 @@ BI.Layout = BI.inherit(BI.Widget, {
return index + "";
},
_addElement: function (i, item) {
_addElement: function (i, item, context) {
var self = this, w;
if (!this.hasWidget(this._getChildName(i))) {
w = BI.createWidget(item);
w = BI.createWidget(item, context);
w.on(BI.Events.DESTROY, function () {
BI.each(self._children, function (name, child) {
if (child === w) {
@ -14798,12 +14798,12 @@ BI.Layout = BI.inherit(BI.Widget, {
w._mount();
},
addItems: function (items) {
addItems: function (items, context) {
var self = this, o = this.options;
var fragment = BI.Widget._renderEngine.createFragment();
var added = [];
BI.each(items, function (i, item) {
var w = self._addElement(o.items.length, item);
var w = self._addElement(o.items.length, item, context);
self._children[self._getChildName(o.items.length)] = w;
o.items.push(item);
added.push(w);
@ -14817,14 +14817,14 @@ BI.Layout = BI.inherit(BI.Widget, {
}
},
prependItems: function (items) {
prependItems: function (items, context) {
var self = this;
items = items || [];
var fragment = BI.Widget._renderEngine.createFragment();
var added = [];
for (var i = items.length - 1; i >= 0; i--) {
this._addItemAt(0, items[i]);
var w = this._addElement(0, items[i]);
var w = this._addElement(0, items[i], context);
self._children[self._getChildName(0)] = w;
this.options.items.unshift(items[i]);
added.push(w);
@ -29932,7 +29932,7 @@ BI.ListView = BI.inherit(BI.Widget, {
};
while ((lastHeight = getElementHeight()) < minContentHeight && index < o.items.length) {
var items = o.items.slice(index, index + o.blockSize);
this.container.addItems(items);
this.container.addItems(items, this);
var addedHeight = getElementHeight() - lastHeight;
this.cache[cnt] = {
index: index,
@ -30051,7 +30051,7 @@ BI.VirtualList = BI.inherit(BI.Widget, {
};
while ((lastHeight = getElementHeight()) < minContentHeight && index < o.items.length) {
var items = o.items.slice(index, index + o.blockSize);
this.container.addItems(items);
this.container.addItems(items, this);
var addedHeight = getElementHeight() - lastHeight;
this.cache[cnt] = {
index: index,
@ -30103,7 +30103,7 @@ BI.VirtualList = BI.inherit(BI.Widget, {
}
if (this.cache[i].destroyed === true) {
for (var j = index; j < index + o.blockSize && j < o.items.length; j++) {
var w = this.container._addElement(j, BI.extend({root: true}, BI.stripEL(o.items[j])));
var w = this.container._addElement(j, BI.extend({root: true}, BI.stripEL(o.items[j])), this);
currentFragment.appendChild(w.element[0]);
}
this.cache[i].destroyed = false;

2
dist/utils.min.js vendored

File diff suppressed because one or more lines are too long

2
src/base/list/listview.js

@ -62,7 +62,7 @@ BI.ListView = BI.inherit(BI.Widget, {
};
while ((lastHeight = getElementHeight()) < minContentHeight && index < o.items.length) {
var items = o.items.slice(index, index + o.blockSize);
this.container.addItems(items);
this.container.addItems(items, this);
var addedHeight = getElementHeight() - lastHeight;
this.cache[cnt] = {
index: index,

4
src/base/list/virtuallist.js

@ -71,7 +71,7 @@ BI.VirtualList = BI.inherit(BI.Widget, {
};
while ((lastHeight = getElementHeight()) < minContentHeight && index < o.items.length) {
var items = o.items.slice(index, index + o.blockSize);
this.container.addItems(items);
this.container.addItems(items, this);
var addedHeight = getElementHeight() - lastHeight;
this.cache[cnt] = {
index: index,
@ -123,7 +123,7 @@ BI.VirtualList = BI.inherit(BI.Widget, {
}
if (this.cache[i].destroyed === true) {
for (var j = index; j < index + o.blockSize && j < o.items.length; j++) {
var w = this.container._addElement(j, BI.extend({root: true}, BI.stripEL(o.items[j])));
var w = this.container._addElement(j, BI.extend({root: true}, BI.stripEL(o.items[j])), this);
currentFragment.appendChild(w.element[0]);
}
this.cache[i].destroyed = false;

12
src/core/wrapper/layout.js

@ -86,10 +86,10 @@ BI.Layout = BI.inherit(BI.Widget, {
return index + "";
},
_addElement: function (i, item) {
_addElement: function (i, item, context) {
var self = this, w;
if (!this.hasWidget(this._getChildName(i))) {
w = BI.createWidget(item);
w = BI.createWidget(item, context);
w.on(BI.Events.DESTROY, function () {
BI.each(self._children, function (name, child) {
if (child === w) {
@ -296,12 +296,12 @@ BI.Layout = BI.inherit(BI.Widget, {
w._mount();
},
addItems: function (items) {
addItems: function (items, context) {
var self = this, o = this.options;
var fragment = BI.Widget._renderEngine.createFragment();
var added = [];
BI.each(items, function (i, item) {
var w = self._addElement(o.items.length, item);
var w = self._addElement(o.items.length, item, context);
self._children[self._getChildName(o.items.length)] = w;
o.items.push(item);
added.push(w);
@ -315,14 +315,14 @@ BI.Layout = BI.inherit(BI.Widget, {
}
},
prependItems: function (items) {
prependItems: function (items, context) {
var self = this;
items = items || [];
var fragment = BI.Widget._renderEngine.createFragment();
var added = [];
for (var i = items.length - 1; i >= 0; i--) {
this._addItemAt(0, items[i]);
var w = this._addElement(0, items[i]);
var w = this._addElement(0, items[i], context);
self._children[self._getChildName(0)] = w;
this.options.items.unshift(items[i]);
added.push(w);

Loading…
Cancel
Save