Browse Source

update

master
guy 7 years ago
parent
commit
a31364de9b
  1. 16
      bi/core.js
  2. 16
      dist/bundle.js
  3. 28
      dist/bundle.min.js
  4. 16
      dist/core.js
  5. 2
      src/core/widget.js
  6. 14
      src/core/wrapper/layout.js

16
bi/core.js

@ -15570,6 +15570,8 @@ BI.Widget = BI.inherit(BI.OB, {
mounted: null,
shouldUpdate: null,
update: function () {
},
@ -22584,6 +22586,17 @@ BI.Layout = BI.inherit(BI.Widget, {
});
},
shouldUpdateItem: function (index, item) {
if (index < 0 || index > this.options.items.length - 1) {
return false;
}
var child = this._children[this._getChildName(index)];
if (!child.shouldUpdate) {
return null;
}
return child.shouldUpdate(this._getOptions(item)) === true;
},
updateItemAt: function (index, item) {
if (index < 0 || index > this.options.items.length - 1) {
return;
@ -22676,7 +22689,8 @@ BI.Layout = BI.inherit(BI.Widget, {
},
patchItem: function (oldVnode, vnode, index) {
if (!this._compare(oldVnode, vnode)) {
var shouldUpdate = this.shouldUpdateItem(index, vnode);
if (shouldUpdate === true || (shouldUpdate === null && !this._compare(oldVnode, vnode))) {
return this.updateItemAt(index, vnode);
}
},

16
dist/bundle.js vendored

@ -14415,6 +14415,8 @@ BI.Widget = BI.inherit(BI.OB, {
mounted: null,
shouldUpdate: null,
update: function () {
},
@ -19798,6 +19800,17 @@ BI.Layout = BI.inherit(BI.Widget, {
});
},
shouldUpdateItem: function (index, item) {
if (index < 0 || index > this.options.items.length - 1) {
return false;
}
var child = this._children[this._getChildName(index)];
if (!child.shouldUpdate) {
return null;
}
return child.shouldUpdate(this._getOptions(item)) === true;
},
updateItemAt: function (index, item) {
if (index < 0 || index > this.options.items.length - 1) {
return;
@ -19890,7 +19903,8 @@ BI.Layout = BI.inherit(BI.Widget, {
},
patchItem: function (oldVnode, vnode, index) {
if (!this._compare(oldVnode, vnode)) {
var shouldUpdate = this.shouldUpdateItem(index, vnode);
if (shouldUpdate === true || (shouldUpdate === null && !this._compare(oldVnode, vnode))) {
return this.updateItemAt(index, vnode);
}
},

28
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

16
dist/core.js vendored

@ -14364,6 +14364,8 @@ BI.Widget = BI.inherit(BI.OB, {
mounted: null,
shouldUpdate: null,
update: function () {
},
@ -19747,6 +19749,17 @@ BI.Layout = BI.inherit(BI.Widget, {
});
},
shouldUpdateItem: function (index, item) {
if (index < 0 || index > this.options.items.length - 1) {
return false;
}
var child = this._children[this._getChildName(index)];
if (!child.shouldUpdate) {
return null;
}
return child.shouldUpdate(this._getOptions(item)) === true;
},
updateItemAt: function (index, item) {
if (index < 0 || index > this.options.items.length - 1) {
return;
@ -19839,7 +19852,8 @@ BI.Layout = BI.inherit(BI.Widget, {
},
patchItem: function (oldVnode, vnode, index) {
if (!this._compare(oldVnode, vnode)) {
var shouldUpdate = this.shouldUpdateItem(index, vnode);
if (shouldUpdate === true || (shouldUpdate === null && !this._compare(oldVnode, vnode))) {
return this.updateItemAt(index, vnode);
}
},

2
src/core/widget.js

@ -34,6 +34,8 @@ BI.Widget = BI.inherit(BI.OB, {
mounted: null,
shouldUpdate: null,
update: function () {
},

14
src/core/wrapper/layout.js

@ -256,6 +256,17 @@ BI.Layout = BI.inherit(BI.Widget, {
});
},
shouldUpdateItem: function (index, item) {
if (index < 0 || index > this.options.items.length - 1) {
return false;
}
var child = this._children[this._getChildName(index)];
if (!child.shouldUpdate) {
return null;
}
return child.shouldUpdate(this._getOptions(item)) === true;
},
updateItemAt: function (index, item) {
if (index < 0 || index > this.options.items.length - 1) {
return;
@ -348,7 +359,8 @@ BI.Layout = BI.inherit(BI.Widget, {
},
patchItem: function (oldVnode, vnode, index) {
if (!this._compare(oldVnode, vnode)) {
var shouldUpdate = this.shouldUpdateItem(index, vnode);
if (shouldUpdate === true || (shouldUpdate === null && !this._compare(oldVnode, vnode))) {
return this.updateItemAt(index, vnode);
}
},

Loading…
Cancel
Save