Browse Source

Merge pull request #1023 in VISUAL/fineui from ~WINDY/fineui:master to master

* commit '7a86ca5eb48e616d20298c31279999cba717908b':
  update
  update
  BI-48176 refactor: widget的_setEnable和_setValid的调用时机修改
es6
guy 6 years ago
parent
commit
eb31b52d9d
  1. 2
      dist/base.js
  2. 2
      src/base/layer/layer.popover.js
  3. 4
      src/case/list/list.select.js
  4. 7
      src/core/widget.js

2
dist/base.js vendored

@ -6337,7 +6337,7 @@ BI.shortcut("bi.popover", BI.Popover);
BI.BarPopover = BI.inherit(BI.Popover, {
_defaultConfig: function () {
return BI.extend(BI.BarPopover.superclass._defaultConfig.apply(this, arguments), {
btns: [BI.i18nText(BI.i18nText("BI-Basic_Sure")), BI.i18nText(BI.i18nText("BI-Basic_Cancel"))]
btns: [BI.i18nText("BI-Basic_Sure"), BI.i18nText("BI-Basic_Cancel")]
});
},

2
src/base/layer/layer.popover.js

@ -209,7 +209,7 @@ BI.shortcut("bi.popover", BI.Popover);
BI.BarPopover = BI.inherit(BI.Popover, {
_defaultConfig: function () {
return BI.extend(BI.BarPopover.superclass._defaultConfig.apply(this, arguments), {
btns: [BI.i18nText(BI.i18nText("BI-Basic_Sure")), BI.i18nText(BI.i18nText("BI-Basic_Cancel"))]
btns: [BI.i18nText("BI-Basic_Sure"), BI.i18nText("BI-Basic_Cancel")]
});
},

4
src/case/list/list.select.js

@ -52,7 +52,7 @@ BI.SelectList = BI.inherit(BI.Widget, {
callback.apply(self, arguments);
if (op.times === 1) {
self.toolbar.setVisible(items && items.length > 0);
self.toolbar.setEnable(items && items.length > 0);
self.toolbar.setEnable(self.isEnabled() && items && items.length > 0);
}
self._checkAllSelected();
});
@ -160,7 +160,7 @@ BI.SelectList = BI.inherit(BI.Widget, {
populate: function (items) {
this.toolbar.setVisible(!BI.isEmptyArray(items));
this.toolbar.setEnable(!BI.isEmptyArray(items));
this.toolbar.setEnable(this.isEnabled() && !BI.isEmptyArray(items));
this.list.populate.apply(this.list, arguments);
this._checkAllSelected();
},

7
src/core/widget.js

@ -188,16 +188,17 @@
* @private
*/
_mount: function (force, deep, lifeHook, predicate) {
var self = this;
if (!force && (this._isMounted || !this.isVisible() || this.__asking === true || !(this._isRoot === true || (this._parent && this._parent._isMounted === true)))) {
return false;
}
lifeHook !== false && this.beforeMount && this.beforeMount();
this._isMounted = true;
this._mountChildren && this._mountChildren();
if(BI.isNotNull(this._parent)) {
!this._parent.isEnabled() && this._setEnable(false);
!this._parent.isValid() && this._setValid(false);
}
BI.each(this._children, function (i, widget) {
!self.isEnabled() && widget._setEnable(false);
!self.isValid() && widget._setValid(false);
widget._mount && widget._mount(deep ? force : false, deep, lifeHook, predicate);
});
lifeHook !== false && this.mounted && this.mounted();

Loading…
Cancel
Save