Browse Source

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

* commit 'e329062b5a49c47dddd0488b9d91ae6fa82b3414':
  enable整理
es6
guy 7 years ago
parent
commit
985c569c14
  1. 89
      bi/base.js
  2. 97
      bi/case.js
  3. 4
      bi/core.css
  4. 35
      bi/core.js
  5. 53
      bi/widget.js
  6. 89
      docs/base.js
  7. 97
      docs/case.js
  8. 4
      docs/core.css
  9. 35
      docs/core.js
  10. 53
      docs/widget.js
  11. 6
      src/base/combination/combo.js
  12. 10
      src/base/combination/expander.js
  13. 7
      src/base/combination/group.button.js
  14. 5
      src/base/combination/group.combo.js
  15. 4
      src/base/combination/loader.js
  16. 8
      src/base/combination/switcher.js
  17. 5
      src/base/layer/layer.popup.js
  18. 4
      src/base/single/button/button.basic.js
  19. 6
      src/base/single/button/buttons/button.js
  20. 4
      src/base/single/editor/editor.code.js
  21. 6
      src/base/single/editor/editor.js
  22. 5
      src/base/single/editor/editor.multifile.js
  23. 6
      src/base/single/editor/editor.textarea.js
  24. 4
      src/base/single/input/file.js
  25. 4
      src/base/single/input/input.js
  26. 5
      src/base/tree/customtree.js
  27. 5
      src/case/button/icon/icon.change.js
  28. 5
      src/case/button/item.multiselect.js
  29. 4
      src/case/colorchooser/colorchooser.js
  30. 4
      src/case/combo/bubblecombo/combo.bubble.js
  31. 5
      src/case/combo/editoriconcheckcombo/combo.editoriconcheck.js
  32. 5
      src/case/combo/iconcombo/combo.icon.js
  33. 5
      src/case/combo/textvaluecheckcombo/combo.textvaluecheck.js
  34. 5
      src/case/combo/textvaluecheckcombo/combo.textvaluechecksmall.js
  35. 5
      src/case/combo/textvaluecombo/combo.textvalue.js
  36. 5
      src/case/combo/textvaluecombo/combo.textvaluesmall.js
  37. 5
      src/case/combo/textvaluedownlistcombo/combo.textvaluedownlist.js
  38. 6
      src/case/editor/editor.search.js
  39. 5
      src/case/editor/editor.state.js
  40. 5
      src/case/editor/editor.state.simple.js
  41. 5
      src/case/editor/editor.text.js
  42. 4
      src/case/segment/segment.js
  43. 7
      src/case/toolbar/toolbar.multiselect.js
  44. 6
      src/case/trigger/trigger.text.js
  45. 6
      src/case/trigger/trigger.text.small.js
  46. 35
      src/core/widget.js
  47. 4
      src/css/core/utils/common.css
  48. 2
      src/less/core/utils/common.less
  49. 4
      src/widget/multiselect/multiselect.loader.js
  50. 4
      src/widget/multiselect/multiselect.popup.view.js
  51. 4
      src/widget/multiselect/multiselect.trigger.js
  52. 4
      src/widget/multiselect/search/multiselect.search.loader.js
  53. 4
      src/widget/multiselect/trigger/editor.multiselect.js
  54. 4
      src/widget/multiselect/trigger/searcher.multiselect.js
  55. 5
      src/widget/multistringlist/multistringlist.js
  56. 4
      src/widget/multitree/multi.tree.combo.js
  57. 4
      src/widget/multitree/multi.tree.popup.js
  58. 4
      src/widget/multitree/trigger/searcher.multi.tree.js
  59. 5
      src/widget/multitreelist/multitreelist.js
  60. 7
      src/widget/numericalinterval/numericalinterval.js

89
bi/base.js

@ -881,8 +881,8 @@ BI.BasicButton = BI.inherit(BI.Single, {
return this.options.text;
},
setEnable: function (b) {
BI.BasicButton.superclass.setEnable.apply(this, arguments);
_setEnable: function (b) {
BI.BasicButton.superclass._setEnable.apply(this, arguments);
if (!b) {
if (this.options.shadow) {
this.$mask && this.$mask.setVisible(false);
@ -1166,13 +1166,6 @@ BI.ButtonGroup = BI.inherit(BI.Widget, {
this.layouts = BI.createWidget(BI.extend({element: this}, this._packageLayout(items)));
},
setEnable: function (b) {
BI.ButtonGroup.superclass.setEnable.apply(this, arguments);
BI.each(this.buttons, function (i, item) {
item.setEnable(b);
});
},
setNotSelectedValue: function (v) {
v = BI.isArray(v) ? v : [v];
BI.each(this.buttons, function (i, item) {
@ -3192,10 +3185,8 @@ BI.Combo = BI.inherit(BI.Widget, {
this.combo.populate.apply(this.combo, arguments);
},
setEnable: function (arg) {
BI.Combo.superclass.setEnable.apply(this, arguments);
this.combo && this.combo.setEnable(arg);
this.popupView && this.popupView.setEnable(arg);
_setEnable: function (arg) {
BI.Combo.superclass._setEnable.apply(this, arguments);
!arg && this.isViewVisible() && this._hideView();
},
@ -3304,7 +3295,7 @@ BI.Expander = BI.inherit(BI.Widget, {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
self.fireEvent(BI.Expander.EVENT_EXPAND);
}
if(type === BI.Events.COLLAPSE) {
if (type === BI.Events.COLLAPSE) {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
self.fireEvent(BI.Expander.EVENT_COLLAPSE);
}
@ -3461,11 +3452,9 @@ BI.Expander = BI.inherit(BI.Widget, {
this.expander.populate.apply(this.expander, arguments);
},
setEnable: function (arg) {
BI.Expander.superclass.setEnable.apply(this, arguments);
this.expander && this.expander.setEnable(arg);
this.popupView && this.popupView.setEnable(arg);
!arg && this._hideView();
_setEnable: function (arg) {
BI.Expander.superclass._setEnable.apply(this, arguments);
!arg && this.isViewVisible() && this._hideView();
},
setValue: function (v) {
@ -3625,11 +3614,6 @@ BI.ComboGroup = BI.inherit(BI.Widget, {
})
},
setEnable: function (b) {
BI.ComboGroup.superclass.setEnable.apply(this, arguments);
this.combo && this.combo.setEnable(b);
},
getValue: function () {
return this.combo.getValue();
},
@ -3920,10 +3904,6 @@ BI.Loader = BI.inherit(BI.Widget, {
this.button_group.populate.apply(this.button_group, arguments);
},
setEnable: function (v) {
this.button_group.setEnable(v);
},
doBehavior: function () {
this.button_group.doBehavior.apply(this.button_group, arguments);
},
@ -4629,11 +4609,9 @@ BI.Switcher = BI.inherit(BI.Widget, {
this.switcher.populate.apply(this.switcher, arguments);
},
setEnable: function (arg) {
BI.Switcher.superclass.setEnable.apply(this, arguments);
this.switcher && this.switcher.setEnable(arg);
this.popupView && this.popupView.setEnable(arg);
!arg && this._hideView();
_setEnable: function (arg) {
BI.Switcher.superclass._setEnable.apply(this, arguments);
!arg && this.isViewVisible() && this._hideView();
},
setValue: function (v) {
@ -15281,11 +15259,6 @@ BI.PopupView = BI.inherit(BI.Widget, {
this.view.element.css({"max-height": (h - tbHeight - tabHeight - toolHeight - 2) + "px"})
},
setEnable: function (arg) {
BI.PopupView.superclass.setEnable.apply(this, arguments);
this.view && this.view.setEnable(arg);
},
setValue: function (selectedValues) {
this.tab && this.tab.setValue(selectedValues);
this.button_group.setValue(selectedValues);
@ -16092,12 +16065,6 @@ BI.shortcut("bi.image_button", BI.ImageButton);(function ($) {
}
},
setEnable: function (b) {
BI.Button.superclass.setEnable.apply(this, arguments);
// this.text.setEnable(b);
// this.icon && this.icon.setEnable(b);
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
@ -17470,8 +17437,8 @@ BI.CodeEditor = BI.inherit(BI.Single, {
}
},
setEnable: function (b) {
BI.CodeEditor.superclass.setEnable.apply(this, arguments);
_setEnable: function (b) {
BI.CodeEditor.superclass._setEnable.apply(this, arguments);
this.editor.setOption("readOnly", b === true ? false : "nocursor")
},
@ -17842,12 +17809,6 @@ BI.Editor = BI.inherit(BI.Single, {
isValid: function () {
return this.editor.isValid();
},
setEnable: function (b) {
BI.Editor.superclass.setEnable.apply(this, arguments);
this.editor && this.editor.setEnable(b);
this.watermark && this.watermark.setEnable(b);
}
});
BI.Editor.EVENT_CHANGE = "EVENT_CHANGE";
@ -17950,11 +17911,6 @@ BI.MultifileEditor = BI.inherit(BI.Single, {
reset: function () {
this.file.reset();
},
setEnable: function (enable) {
BI.MultiFile.superclass.setEnable.apply(this, arguments);
this.file.setEnable(enable);
}
});
BI.MultifileEditor.EVENT_CHANGE = "MultifileEditor.EVENT_CHANGE";
@ -18117,12 +18073,6 @@ BI.TextAreaEditor = BI.inherit(BI.Single, {
BI.TextAreaEditor.superclass.setValid.apply(this, arguments);
this.content.setValid(b);
this.watermark && this.watermark.setValid(b);
},
setEnable: function (b) {
BI.TextAreaEditor.superclass.setEnable.apply(this, arguments);
this.content.setEnable(b);
this.watermark && this.watermark.setEnable(b);
}
});
BI.TextAreaEditor.EVENT_CHANGE = "EVENT_CHANGE";
@ -18857,8 +18807,8 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
this.wrap.attachNum = 0;
},
setEnable: function (enable) {
BI.File.superclass.setEnable.apply(this, arguments);
_setEnable: function (enable) {
BI.File.superclass._setEnable.apply(this, arguments);
if (enable === true) {
this.element.attr("disabled", "disabled");
} else {
@ -19130,8 +19080,8 @@ BI.Input = BI.inherit(BI.Single, {
}
},
setEnable: function (b) {
BI.Input.superclass.setEnable.apply(this, [b]);
_setEnable: function (b) {
BI.Input.superclass._setEnable.apply(this, [b]);
this.element[0].disabled = !b;
}
});
@ -32563,11 +32513,6 @@ BI.CustomTree = BI.inherit(BI.Widget, {
this.initTree(this.options.items);
},
setEnable: function (v) {
BI.CustomTree.superclass.setEnable.apply(this, arguments);
this.tree.setEnable(v)
},
_formatItems: function (nodes) {
var self = this, o = this.options;
nodes = BI.Tree.transformToTreeFormat(nodes);

97
bi/case.js

@ -77,11 +77,6 @@ BI.IconChangeButton = BI.inherit(BI.Single, {
this.element.removeClass(o.iconClass).addClass(cls);
o.iconClass = cls;
}
},
setEnable: function (b) {
BI.IconChangeButton.superclass.setEnable.apply(this, arguments);
this.button.setEnable(b);
}
});
BI.IconChangeButton.EVENT_CHANGE = "IconChangeButton.EVENT_CHANGE";
@ -197,11 +192,6 @@ BI.MultiSelectItem = BI.inherit(BI.BasicButton, {
}))));
},
setEnable: function (v) {
BI.MultiSelectItem.superclass.setEnable.apply(this, arguments);
this.checkbox.setEnable(v);
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
@ -2373,10 +2363,6 @@ BI.ColorChooser = BI.inherit(BI.Widget, {
return this.combo.isViewVisible();
},
setEnable: function (v) {
this.combo.setEnable(v)
},
setValue: function (color) {
this.combo.setValue(color);
},
@ -3600,10 +3586,6 @@ BI.BubbleCombo = BI.inherit(BI.Widget, {
isViewVisible: function () {
return this.combo.isViewVisible();
},
setEnable: function (v) {
this.combo.setEnable(!!v);
}
});
@ -3799,11 +3781,6 @@ BI.EditorIconCheckCombo = BI.inherit(BI.Widget, {
this.editorIconCheckCombo.setValue(v);
},
setEnable: function (v) {
BI.EditorIconCheckCombo.superclass.setEnable.apply(this, arguments);
this.editorIconCheckCombo.setEnable(v);
},
getValue: function () {
return this.trigger.getValue();
},
@ -4141,11 +4118,6 @@ BI.IconCombo = BI.inherit(BI.Widget, {
this.iconCombo.setValue(v);
},
setEnable: function (v) {
BI.IconCombo.superclass.setEnable.apply(this, arguments);
this.iconCombo.setEnable(v);
},
getValue: function () {
return this.iconCombo.getValue();
},
@ -4431,11 +4403,6 @@ BI.TextValueCheckCombo = BI.inherit(BI.Widget, {
this.textIconCheckCombo.setValue(v);
},
setEnable: function (v) {
BI.TextValueCheckCombo.superclass.setEnable.apply(this, arguments);
this.textIconCheckCombo.setEnable(v);
},
setWarningTitle: function (title) {
this.trigger.setWarningTitle(title);
},
@ -4503,11 +4470,6 @@ BI.SmallTextValueCheckCombo = BI.inherit(BI.Widget, {
this.SmallTextIconCheckCombo.setValue(v);
},
setEnable: function (v) {
BI.SmallTextValueCheckCombo.superclass.setEnable.apply(this, arguments);
this.SmallTextIconCheckCombo.setEnable(v);
},
getValue: function () {
return this.SmallTextIconCheckCombo.getValue();
},
@ -4632,11 +4594,6 @@ BI.TextValueCombo = BI.inherit(BI.Widget, {
this.textIconCombo.setValue(v);
},
setEnable: function (v) {
BI.TextValueCombo.superclass.setEnable.apply(this, arguments);
this.textIconCombo.setEnable(v);
},
getValue: function () {
return this.textIconCombo.getValue();
},
@ -4702,11 +4659,6 @@ BI.SmallTextValueCombo = BI.inherit(BI.Widget, {
this.SmallTextValueCombo.setValue(v);
},
setEnable: function (v) {
BI.SmallTextValueCombo.superclass.setEnable.apply(this, arguments);
this.SmallTextValueCombo.setEnable(v);
},
getValue: function () {
return this.SmallTextValueCombo.getValue();
},
@ -4840,11 +4792,6 @@ BI.TextValueDownListCombo = BI.inherit(BI.Widget, {
this.trigger.setValue(v.childValue || v.value);
},
setEnable: function (v) {
BI.TextValueDownListCombo.superclass.setEnable.apply(this, arguments);
this.combo.setEnable(v);
},
getValue: function () {
var v = this.combo.getValue()[0];
return [v.childValue || v.value];
@ -5248,12 +5195,6 @@ BI.SearchEditor = BI.inherit(BI.Widget, {
isValid: function () {
return this.editor.isValid();
},
setEnable: function (b) {
BI.Editor.superclass.setEnable.apply(this, arguments);
this.editor && this.editor.setEnable(b);
this.clear.setEnable(b);
}
});
BI.SearchEditor.EVENT_CHANGE = "EVENT_CHANGE";
@ -6186,11 +6127,6 @@ BI.StateEditor = BI.inherit(BI.Widget, {
this.editor.setValue(k);
},
setEnable: function (v) {
this.text.setEnable(v);
this.editor.setEnable(v);
},
getValue: function () {
return this.editor.getValue();
},
@ -6464,11 +6400,6 @@ BI.SimpleStateEditor = BI.inherit(BI.Widget, {
this.editor.setValue(k);
},
setEnable: function(v){
this.text.setEnable(v);
this.editor.setEnable(v);
},
getValue: function () {
return this.editor.getValue();
},
@ -6666,11 +6597,6 @@ BI.TextEditor = BI.inherit(BI.Widget, {
getValue: function () {
return this.editor.getValue();
},
setEnable: function (b) {
BI.Editor.superclass.setEnable.apply(this, arguments);
this.editor && this.editor.setEnable(b);
}
});
BI.TextEditor.EVENT_CHANGE = "EVENT_CHANGE";
@ -8714,10 +8640,6 @@ BI.Segment = BI.inherit(BI.Widget, {
this.buttonGroup.setEnabledValue(v);
},
setEnable: function (v) {
this.buttonGroup.setEnable(v);
},
getValue: function () {
return this.buttonGroup.getValue();
}
@ -10452,13 +10374,6 @@ BI.MultiSelectBar = BI.inherit(BI.BasicButton, {
var isAllChecked = this.options.isAllCheckedBySelectedValue.apply(this, arguments);
this.setSelected(isAllChecked);
!isAllChecked && this.setHalfSelected(this.options.isHalfCheckedBySelectedValue.apply(this, arguments));
},
setEnable: function (b) {
BI.MultiSelectBar.superclass.setEnable.apply(this, arguments);
this.checkbox.setEnable(b);
this.half.setEnable(b);
this.text.setEnable(b);
}
});
BI.MultiSelectBar.EVENT_CHANGE = "MultiSelectBar.EVENT_CHANGE";
@ -11157,12 +11072,6 @@ BI.TextTrigger = BI.inherit(BI.Trigger, {
});
},
setEnable: function (v) {
BI.TextTrigger.superclass.setEnable.apply(this, arguments);
this.trigerButton.setEnable(v);
this.text.setEnable(v);
},
setValue: function (value) {
this.text.setValue(value);
this.text.setTitle(value);
@ -11327,12 +11236,6 @@ BI.SmallTextTrigger = BI.inherit(BI.Trigger, {
});
},
setEnable: function (v) {
BI.SmallTextTrigger.superclass.setEnable.apply(this, arguments);
this.trigerButton.setEnable(v);
this.text.setEnable(v);
},
setValue: function (value) {
this.text.setValue(value);
},

4
bi/core.css

@ -3078,8 +3078,8 @@ i {
}
.bi-z-index-mask {
color: #ffffff;
background-color: rgba(26, 26, 26, 0.3);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#4d1a1a1a,endColorstr=#4d1a1a1a);
background-color: rgba(26, 26, 26, 0.5);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#801a1a1a,endColorstr=#801a1a1a);
}
.bi-list-item:hover,
.bi-list-item.hover {

35
bi/core.js

@ -4432,17 +4432,18 @@ BI.Widget = BI.inherit(BI.OB, {
_initVisualEffects: function () {
var o = this.options;
if (o.invisible) {
this.element.hide();
//用display属性做显示和隐藏,否则jquery会在显示时将display设为block会覆盖掉display:flex属性
this.element.css("display", "none");
}
if (o.disabled || o.invalid) {
BI.nextTick(BI.bind(function () {
if (this.options.disabled) {
this.setEnable(false);
}
if (this.options.invalid) {
this.setValid(false);
}
}, this));
// BI.nextTick(BI.bind(function () {
if (this.options.disabled) {
this.setEnable(false);
}
if (this.options.invalid) {
this.setValid(false);
}
// }, this));
}
},
@ -4490,6 +4491,7 @@ BI.Widget = BI.inherit(BI.OB, {
this._isMounted = true;
this._mountChildren && this._mountChildren();
BI.each(this._children, function (i, widget) {
!self.isEnabled() && widget._setEnable(false);
widget._mount && widget._mount();
});
this.mounted && this.mounted();
@ -4511,12 +4513,23 @@ BI.Widget = BI.inherit(BI.OB, {
this._initElementHeight();
},
setEnable: function (enable) {
_setEnable: function (enable) {
if (enable === true) {
this.options.disabled = false;
this.element.removeClass("base-disabled disabled");
} else if (enable === false) {
this.options.disabled = true;
}
//递归将所有子组件使能
BI.each(this._children, function (i, child) {
child._setEnable && child._setEnable(enable);
});
},
setEnable: function (enable) {
this._setEnable(enable);
if (enable === true) {
this.element.removeClass("base-disabled disabled");
} else if (enable === false) {
this.element.addClass("base-disabled disabled");
}
},

53
bi/widget.js

@ -10048,10 +10048,6 @@ BI.MultiSelectLoader = BI.inherit(BI.Widget, {
this.button_group.populate.apply(this.button_group, arguments);
},
setEnable: function (arg) {
this.button_group.setEnable(arg);
},
resetHeight: function (h) {
this.button_group.resetHeight(h);
},
@ -10138,10 +10134,6 @@ BI.MultiSelectPopupView = BI.inherit(BI.Widget, {
this.popupView.populate.apply(this.popupView, arguments);
},
setEnable: function (arg) {
this.popupView.setEnable(arg);
},
resetHeight: function (h) {
this.popupView.resetHeight(h);
},
@ -10291,10 +10283,6 @@ BI.MultiSelectTrigger = BI.inherit(BI.Trigger, {
this.numberCounter.setValue(ob);
},
setEnable: function (v) {
this.searcher.setEnable(v);
},
getKey: function () {
return this.searcher.getKey();
},
@ -10454,10 +10442,6 @@ BI.MultiSelectSearchLoader = BI.inherit(BI.Widget, {
this.button_group.populate.apply(this.button_group, arguments);
},
setEnable: function (arg) {
this.button_group.setEnable(arg);
},
resetHeight: function (h) {
this.button_group.resetHeight(h);
},
@ -10703,10 +10687,6 @@ BI.MultiSelectEditor = BI.inherit(BI.Widget, {
this.editor.setValue(v);
},
setEnable: function(v){
this.editor.setEnable(v);
},
getValue: function () {
var v = this.editor.getState();
if (BI.isArray(v) && v.length > 0) {
@ -10866,10 +10846,6 @@ BI.MultiSelectSearcher = BI.inherit(BI.Widget, {
return this.searcher.getValue();
},
setEnable: function (v) {
this.editor.setEnable(v);
},
populate: function (items) {
this.searcher.populate.apply(this.searcher, arguments);
}
@ -11267,11 +11243,6 @@ BI.MultiStringList = BI.inherit(BI.Widget, {
this.trigger.getSearcher().adjustView();
},
setEnable: function (v) {
this.trigger.setEnable(v);
this.popup.setEnable(v);
},
setValue: function (v) {
this.storeValue = v || {};
this._assertValue(this.storeValue);
@ -11649,10 +11620,6 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
this.combo.hideView();
},
setEnable: function (v) {
this.combo.setEnable(v);
},
setValue: function (v) {
this.storeValue.value = v || {};
this.combo.setValue({
@ -11752,10 +11719,6 @@ BI.MultiTreePopup = BI.inherit(BI.Pane, {
return this.tree.hasChecked();
},
setEnable: function (arg) {
this.popupView.setEnable(arg);
},
resetHeight: function (h) {
this.popupView.resetHeight(h);
},
@ -12030,10 +11993,6 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
return this.editor.getValue();
},
setEnable: function(v){
this.editor.setEnable(v);
},
getValue: function () {
return this.searcher.getValue();
},
@ -12200,11 +12159,6 @@ BI.MultiTreeList = BI.inherit(BI.Widget, {
this.trigger.getSearcher().adjustView();
},
setEnable: function (v) {
this.trigger.setEnable(v);
this.popup.setEnable(v);
},
setValue: function (v) {
this.storeValue.value = v || {};
this.popup.setValue({
@ -12704,13 +12658,6 @@ BI.NumericalInterval = BI.inherit(BI.Single, {
return this.options.validation === "valid";
},
setEnable: function (b) {
this.smallEditor.setEnable(b);
this.smallCombo.setEnable(b);
this.bigEditor.setEnable(b);
this.bigCombo.setEnable(b);
},
setMinEnable: function (b) {
this.smallEditor.setEnable(b);
},

89
docs/base.js

@ -881,8 +881,8 @@ BI.BasicButton = BI.inherit(BI.Single, {
return this.options.text;
},
setEnable: function (b) {
BI.BasicButton.superclass.setEnable.apply(this, arguments);
_setEnable: function (b) {
BI.BasicButton.superclass._setEnable.apply(this, arguments);
if (!b) {
if (this.options.shadow) {
this.$mask && this.$mask.setVisible(false);
@ -1166,13 +1166,6 @@ BI.ButtonGroup = BI.inherit(BI.Widget, {
this.layouts = BI.createWidget(BI.extend({element: this}, this._packageLayout(items)));
},
setEnable: function (b) {
BI.ButtonGroup.superclass.setEnable.apply(this, arguments);
BI.each(this.buttons, function (i, item) {
item.setEnable(b);
});
},
setNotSelectedValue: function (v) {
v = BI.isArray(v) ? v : [v];
BI.each(this.buttons, function (i, item) {
@ -3192,10 +3185,8 @@ BI.Combo = BI.inherit(BI.Widget, {
this.combo.populate.apply(this.combo, arguments);
},
setEnable: function (arg) {
BI.Combo.superclass.setEnable.apply(this, arguments);
this.combo && this.combo.setEnable(arg);
this.popupView && this.popupView.setEnable(arg);
_setEnable: function (arg) {
BI.Combo.superclass._setEnable.apply(this, arguments);
!arg && this.isViewVisible() && this._hideView();
},
@ -3304,7 +3295,7 @@ BI.Expander = BI.inherit(BI.Widget, {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
self.fireEvent(BI.Expander.EVENT_EXPAND);
}
if(type === BI.Events.COLLAPSE) {
if (type === BI.Events.COLLAPSE) {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
self.fireEvent(BI.Expander.EVENT_COLLAPSE);
}
@ -3461,11 +3452,9 @@ BI.Expander = BI.inherit(BI.Widget, {
this.expander.populate.apply(this.expander, arguments);
},
setEnable: function (arg) {
BI.Expander.superclass.setEnable.apply(this, arguments);
this.expander && this.expander.setEnable(arg);
this.popupView && this.popupView.setEnable(arg);
!arg && this._hideView();
_setEnable: function (arg) {
BI.Expander.superclass._setEnable.apply(this, arguments);
!arg && this.isViewVisible() && this._hideView();
},
setValue: function (v) {
@ -3625,11 +3614,6 @@ BI.ComboGroup = BI.inherit(BI.Widget, {
})
},
setEnable: function (b) {
BI.ComboGroup.superclass.setEnable.apply(this, arguments);
this.combo && this.combo.setEnable(b);
},
getValue: function () {
return this.combo.getValue();
},
@ -3920,10 +3904,6 @@ BI.Loader = BI.inherit(BI.Widget, {
this.button_group.populate.apply(this.button_group, arguments);
},
setEnable: function (v) {
this.button_group.setEnable(v);
},
doBehavior: function () {
this.button_group.doBehavior.apply(this.button_group, arguments);
},
@ -4629,11 +4609,9 @@ BI.Switcher = BI.inherit(BI.Widget, {
this.switcher.populate.apply(this.switcher, arguments);
},
setEnable: function (arg) {
BI.Switcher.superclass.setEnable.apply(this, arguments);
this.switcher && this.switcher.setEnable(arg);
this.popupView && this.popupView.setEnable(arg);
!arg && this._hideView();
_setEnable: function (arg) {
BI.Switcher.superclass._setEnable.apply(this, arguments);
!arg && this.isViewVisible() && this._hideView();
},
setValue: function (v) {
@ -15281,11 +15259,6 @@ BI.PopupView = BI.inherit(BI.Widget, {
this.view.element.css({"max-height": (h - tbHeight - tabHeight - toolHeight - 2) + "px"})
},
setEnable: function (arg) {
BI.PopupView.superclass.setEnable.apply(this, arguments);
this.view && this.view.setEnable(arg);
},
setValue: function (selectedValues) {
this.tab && this.tab.setValue(selectedValues);
this.button_group.setValue(selectedValues);
@ -16092,12 +16065,6 @@ BI.shortcut("bi.image_button", BI.ImageButton);(function ($) {
}
},
setEnable: function (b) {
BI.Button.superclass.setEnable.apply(this, arguments);
// this.text.setEnable(b);
// this.icon && this.icon.setEnable(b);
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
@ -17470,8 +17437,8 @@ BI.CodeEditor = BI.inherit(BI.Single, {
}
},
setEnable: function (b) {
BI.CodeEditor.superclass.setEnable.apply(this, arguments);
_setEnable: function (b) {
BI.CodeEditor.superclass._setEnable.apply(this, arguments);
this.editor.setOption("readOnly", b === true ? false : "nocursor")
},
@ -17842,12 +17809,6 @@ BI.Editor = BI.inherit(BI.Single, {
isValid: function () {
return this.editor.isValid();
},
setEnable: function (b) {
BI.Editor.superclass.setEnable.apply(this, arguments);
this.editor && this.editor.setEnable(b);
this.watermark && this.watermark.setEnable(b);
}
});
BI.Editor.EVENT_CHANGE = "EVENT_CHANGE";
@ -17950,11 +17911,6 @@ BI.MultifileEditor = BI.inherit(BI.Single, {
reset: function () {
this.file.reset();
},
setEnable: function (enable) {
BI.MultiFile.superclass.setEnable.apply(this, arguments);
this.file.setEnable(enable);
}
});
BI.MultifileEditor.EVENT_CHANGE = "MultifileEditor.EVENT_CHANGE";
@ -18117,12 +18073,6 @@ BI.TextAreaEditor = BI.inherit(BI.Single, {
BI.TextAreaEditor.superclass.setValid.apply(this, arguments);
this.content.setValid(b);
this.watermark && this.watermark.setValid(b);
},
setEnable: function (b) {
BI.TextAreaEditor.superclass.setEnable.apply(this, arguments);
this.content.setEnable(b);
this.watermark && this.watermark.setEnable(b);
}
});
BI.TextAreaEditor.EVENT_CHANGE = "EVENT_CHANGE";
@ -18857,8 +18807,8 @@ BI.shortcut("bi.checkbox", BI.Checkbox);/**
this.wrap.attachNum = 0;
},
setEnable: function (enable) {
BI.File.superclass.setEnable.apply(this, arguments);
_setEnable: function (enable) {
BI.File.superclass._setEnable.apply(this, arguments);
if (enable === true) {
this.element.attr("disabled", "disabled");
} else {
@ -19130,8 +19080,8 @@ BI.Input = BI.inherit(BI.Single, {
}
},
setEnable: function (b) {
BI.Input.superclass.setEnable.apply(this, [b]);
_setEnable: function (b) {
BI.Input.superclass._setEnable.apply(this, [b]);
this.element[0].disabled = !b;
}
});
@ -32563,11 +32513,6 @@ BI.CustomTree = BI.inherit(BI.Widget, {
this.initTree(this.options.items);
},
setEnable: function (v) {
BI.CustomTree.superclass.setEnable.apply(this, arguments);
this.tree.setEnable(v)
},
_formatItems: function (nodes) {
var self = this, o = this.options;
nodes = BI.Tree.transformToTreeFormat(nodes);

97
docs/case.js

@ -77,11 +77,6 @@ BI.IconChangeButton = BI.inherit(BI.Single, {
this.element.removeClass(o.iconClass).addClass(cls);
o.iconClass = cls;
}
},
setEnable: function (b) {
BI.IconChangeButton.superclass.setEnable.apply(this, arguments);
this.button.setEnable(b);
}
});
BI.IconChangeButton.EVENT_CHANGE = "IconChangeButton.EVENT_CHANGE";
@ -197,11 +192,6 @@ BI.MultiSelectItem = BI.inherit(BI.BasicButton, {
}))));
},
setEnable: function (v) {
BI.MultiSelectItem.superclass.setEnable.apply(this, arguments);
this.checkbox.setEnable(v);
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
@ -2373,10 +2363,6 @@ BI.ColorChooser = BI.inherit(BI.Widget, {
return this.combo.isViewVisible();
},
setEnable: function (v) {
this.combo.setEnable(v)
},
setValue: function (color) {
this.combo.setValue(color);
},
@ -3600,10 +3586,6 @@ BI.BubbleCombo = BI.inherit(BI.Widget, {
isViewVisible: function () {
return this.combo.isViewVisible();
},
setEnable: function (v) {
this.combo.setEnable(!!v);
}
});
@ -3799,11 +3781,6 @@ BI.EditorIconCheckCombo = BI.inherit(BI.Widget, {
this.editorIconCheckCombo.setValue(v);
},
setEnable: function (v) {
BI.EditorIconCheckCombo.superclass.setEnable.apply(this, arguments);
this.editorIconCheckCombo.setEnable(v);
},
getValue: function () {
return this.trigger.getValue();
},
@ -4141,11 +4118,6 @@ BI.IconCombo = BI.inherit(BI.Widget, {
this.iconCombo.setValue(v);
},
setEnable: function (v) {
BI.IconCombo.superclass.setEnable.apply(this, arguments);
this.iconCombo.setEnable(v);
},
getValue: function () {
return this.iconCombo.getValue();
},
@ -4431,11 +4403,6 @@ BI.TextValueCheckCombo = BI.inherit(BI.Widget, {
this.textIconCheckCombo.setValue(v);
},
setEnable: function (v) {
BI.TextValueCheckCombo.superclass.setEnable.apply(this, arguments);
this.textIconCheckCombo.setEnable(v);
},
setWarningTitle: function (title) {
this.trigger.setWarningTitle(title);
},
@ -4503,11 +4470,6 @@ BI.SmallTextValueCheckCombo = BI.inherit(BI.Widget, {
this.SmallTextIconCheckCombo.setValue(v);
},
setEnable: function (v) {
BI.SmallTextValueCheckCombo.superclass.setEnable.apply(this, arguments);
this.SmallTextIconCheckCombo.setEnable(v);
},
getValue: function () {
return this.SmallTextIconCheckCombo.getValue();
},
@ -4632,11 +4594,6 @@ BI.TextValueCombo = BI.inherit(BI.Widget, {
this.textIconCombo.setValue(v);
},
setEnable: function (v) {
BI.TextValueCombo.superclass.setEnable.apply(this, arguments);
this.textIconCombo.setEnable(v);
},
getValue: function () {
return this.textIconCombo.getValue();
},
@ -4702,11 +4659,6 @@ BI.SmallTextValueCombo = BI.inherit(BI.Widget, {
this.SmallTextValueCombo.setValue(v);
},
setEnable: function (v) {
BI.SmallTextValueCombo.superclass.setEnable.apply(this, arguments);
this.SmallTextValueCombo.setEnable(v);
},
getValue: function () {
return this.SmallTextValueCombo.getValue();
},
@ -4840,11 +4792,6 @@ BI.TextValueDownListCombo = BI.inherit(BI.Widget, {
this.trigger.setValue(v.childValue || v.value);
},
setEnable: function (v) {
BI.TextValueDownListCombo.superclass.setEnable.apply(this, arguments);
this.combo.setEnable(v);
},
getValue: function () {
var v = this.combo.getValue()[0];
return [v.childValue || v.value];
@ -5248,12 +5195,6 @@ BI.SearchEditor = BI.inherit(BI.Widget, {
isValid: function () {
return this.editor.isValid();
},
setEnable: function (b) {
BI.Editor.superclass.setEnable.apply(this, arguments);
this.editor && this.editor.setEnable(b);
this.clear.setEnable(b);
}
});
BI.SearchEditor.EVENT_CHANGE = "EVENT_CHANGE";
@ -6186,11 +6127,6 @@ BI.StateEditor = BI.inherit(BI.Widget, {
this.editor.setValue(k);
},
setEnable: function (v) {
this.text.setEnable(v);
this.editor.setEnable(v);
},
getValue: function () {
return this.editor.getValue();
},
@ -6464,11 +6400,6 @@ BI.SimpleStateEditor = BI.inherit(BI.Widget, {
this.editor.setValue(k);
},
setEnable: function(v){
this.text.setEnable(v);
this.editor.setEnable(v);
},
getValue: function () {
return this.editor.getValue();
},
@ -6666,11 +6597,6 @@ BI.TextEditor = BI.inherit(BI.Widget, {
getValue: function () {
return this.editor.getValue();
},
setEnable: function (b) {
BI.Editor.superclass.setEnable.apply(this, arguments);
this.editor && this.editor.setEnable(b);
}
});
BI.TextEditor.EVENT_CHANGE = "EVENT_CHANGE";
@ -8714,10 +8640,6 @@ BI.Segment = BI.inherit(BI.Widget, {
this.buttonGroup.setEnabledValue(v);
},
setEnable: function (v) {
this.buttonGroup.setEnable(v);
},
getValue: function () {
return this.buttonGroup.getValue();
}
@ -10452,13 +10374,6 @@ BI.MultiSelectBar = BI.inherit(BI.BasicButton, {
var isAllChecked = this.options.isAllCheckedBySelectedValue.apply(this, arguments);
this.setSelected(isAllChecked);
!isAllChecked && this.setHalfSelected(this.options.isHalfCheckedBySelectedValue.apply(this, arguments));
},
setEnable: function (b) {
BI.MultiSelectBar.superclass.setEnable.apply(this, arguments);
this.checkbox.setEnable(b);
this.half.setEnable(b);
this.text.setEnable(b);
}
});
BI.MultiSelectBar.EVENT_CHANGE = "MultiSelectBar.EVENT_CHANGE";
@ -11157,12 +11072,6 @@ BI.TextTrigger = BI.inherit(BI.Trigger, {
});
},
setEnable: function (v) {
BI.TextTrigger.superclass.setEnable.apply(this, arguments);
this.trigerButton.setEnable(v);
this.text.setEnable(v);
},
setValue: function (value) {
this.text.setValue(value);
this.text.setTitle(value);
@ -11327,12 +11236,6 @@ BI.SmallTextTrigger = BI.inherit(BI.Trigger, {
});
},
setEnable: function (v) {
BI.SmallTextTrigger.superclass.setEnable.apply(this, arguments);
this.trigerButton.setEnable(v);
this.text.setEnable(v);
},
setValue: function (value) {
this.text.setValue(value);
},

4
docs/core.css

@ -3078,8 +3078,8 @@ i {
}
.bi-z-index-mask {
color: #ffffff;
background-color: rgba(26, 26, 26, 0.3);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#4d1a1a1a,endColorstr=#4d1a1a1a);
background-color: rgba(26, 26, 26, 0.5);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#801a1a1a,endColorstr=#801a1a1a);
}
.bi-list-item:hover,
.bi-list-item.hover {

35
docs/core.js

@ -14427,17 +14427,18 @@ BI.Widget = BI.inherit(BI.OB, {
_initVisualEffects: function () {
var o = this.options;
if (o.invisible) {
this.element.hide();
//用display属性做显示和隐藏,否则jquery会在显示时将display设为block会覆盖掉display:flex属性
this.element.css("display", "none");
}
if (o.disabled || o.invalid) {
BI.nextTick(BI.bind(function () {
if (this.options.disabled) {
this.setEnable(false);
}
if (this.options.invalid) {
this.setValid(false);
}
}, this));
// BI.nextTick(BI.bind(function () {
if (this.options.disabled) {
this.setEnable(false);
}
if (this.options.invalid) {
this.setValid(false);
}
// }, this));
}
},
@ -14485,6 +14486,7 @@ BI.Widget = BI.inherit(BI.OB, {
this._isMounted = true;
this._mountChildren && this._mountChildren();
BI.each(this._children, function (i, widget) {
!self.isEnabled() && widget._setEnable(false);
widget._mount && widget._mount();
});
this.mounted && this.mounted();
@ -14506,12 +14508,23 @@ BI.Widget = BI.inherit(BI.OB, {
this._initElementHeight();
},
setEnable: function (enable) {
_setEnable: function (enable) {
if (enable === true) {
this.options.disabled = false;
this.element.removeClass("base-disabled disabled");
} else if (enable === false) {
this.options.disabled = true;
}
//递归将所有子组件使能
BI.each(this._children, function (i, child) {
child._setEnable && child._setEnable(enable);
});
},
setEnable: function (enable) {
this._setEnable(enable);
if (enable === true) {
this.element.removeClass("base-disabled disabled");
} else if (enable === false) {
this.element.addClass("base-disabled disabled");
}
},

53
docs/widget.js

@ -10048,10 +10048,6 @@ BI.MultiSelectLoader = BI.inherit(BI.Widget, {
this.button_group.populate.apply(this.button_group, arguments);
},
setEnable: function (arg) {
this.button_group.setEnable(arg);
},
resetHeight: function (h) {
this.button_group.resetHeight(h);
},
@ -10138,10 +10134,6 @@ BI.MultiSelectPopupView = BI.inherit(BI.Widget, {
this.popupView.populate.apply(this.popupView, arguments);
},
setEnable: function (arg) {
this.popupView.setEnable(arg);
},
resetHeight: function (h) {
this.popupView.resetHeight(h);
},
@ -10291,10 +10283,6 @@ BI.MultiSelectTrigger = BI.inherit(BI.Trigger, {
this.numberCounter.setValue(ob);
},
setEnable: function (v) {
this.searcher.setEnable(v);
},
getKey: function () {
return this.searcher.getKey();
},
@ -10454,10 +10442,6 @@ BI.MultiSelectSearchLoader = BI.inherit(BI.Widget, {
this.button_group.populate.apply(this.button_group, arguments);
},
setEnable: function (arg) {
this.button_group.setEnable(arg);
},
resetHeight: function (h) {
this.button_group.resetHeight(h);
},
@ -10703,10 +10687,6 @@ BI.MultiSelectEditor = BI.inherit(BI.Widget, {
this.editor.setValue(v);
},
setEnable: function(v){
this.editor.setEnable(v);
},
getValue: function () {
var v = this.editor.getState();
if (BI.isArray(v) && v.length > 0) {
@ -10866,10 +10846,6 @@ BI.MultiSelectSearcher = BI.inherit(BI.Widget, {
return this.searcher.getValue();
},
setEnable: function (v) {
this.editor.setEnable(v);
},
populate: function (items) {
this.searcher.populate.apply(this.searcher, arguments);
}
@ -11267,11 +11243,6 @@ BI.MultiStringList = BI.inherit(BI.Widget, {
this.trigger.getSearcher().adjustView();
},
setEnable: function (v) {
this.trigger.setEnable(v);
this.popup.setEnable(v);
},
setValue: function (v) {
this.storeValue = v || {};
this._assertValue(this.storeValue);
@ -11649,10 +11620,6 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
this.combo.hideView();
},
setEnable: function (v) {
this.combo.setEnable(v);
},
setValue: function (v) {
this.storeValue.value = v || {};
this.combo.setValue({
@ -11752,10 +11719,6 @@ BI.MultiTreePopup = BI.inherit(BI.Pane, {
return this.tree.hasChecked();
},
setEnable: function (arg) {
this.popupView.setEnable(arg);
},
resetHeight: function (h) {
this.popupView.resetHeight(h);
},
@ -12030,10 +11993,6 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
return this.editor.getValue();
},
setEnable: function(v){
this.editor.setEnable(v);
},
getValue: function () {
return this.searcher.getValue();
},
@ -12200,11 +12159,6 @@ BI.MultiTreeList = BI.inherit(BI.Widget, {
this.trigger.getSearcher().adjustView();
},
setEnable: function (v) {
this.trigger.setEnable(v);
this.popup.setEnable(v);
},
setValue: function (v) {
this.storeValue.value = v || {};
this.popup.setValue({
@ -12704,13 +12658,6 @@ BI.NumericalInterval = BI.inherit(BI.Single, {
return this.options.validation === "valid";
},
setEnable: function (b) {
this.smallEditor.setEnable(b);
this.smallCombo.setEnable(b);
this.bigEditor.setEnable(b);
this.bigCombo.setEnable(b);
},
setMinEnable: function (b) {
this.smallEditor.setEnable(b);
},

6
src/base/combination/combo.js

@ -325,10 +325,8 @@ BI.Combo = BI.inherit(BI.Widget, {
this.combo.populate.apply(this.combo, arguments);
},
setEnable: function (arg) {
BI.Combo.superclass.setEnable.apply(this, arguments);
this.combo && this.combo.setEnable(arg);
this.popupView && this.popupView.setEnable(arg);
_setEnable: function (arg) {
BI.Combo.superclass._setEnable.apply(this, arguments);
!arg && this.isViewVisible() && this._hideView();
},

10
src/base/combination/expander.js

@ -39,7 +39,7 @@ BI.Expander = BI.inherit(BI.Widget, {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
self.fireEvent(BI.Expander.EVENT_EXPAND);
}
if(type === BI.Events.COLLAPSE) {
if (type === BI.Events.COLLAPSE) {
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
self.fireEvent(BI.Expander.EVENT_COLLAPSE);
}
@ -196,11 +196,9 @@ BI.Expander = BI.inherit(BI.Widget, {
this.expander.populate.apply(this.expander, arguments);
},
setEnable: function (arg) {
BI.Expander.superclass.setEnable.apply(this, arguments);
this.expander && this.expander.setEnable(arg);
this.popupView && this.popupView.setEnable(arg);
!arg && this._hideView();
_setEnable: function (arg) {
BI.Expander.superclass._setEnable.apply(this, arguments);
!arg && this.isViewVisible() && this._hideView();
},
setValue: function (v) {

7
src/base/combination/group.button.js

@ -189,13 +189,6 @@ BI.ButtonGroup = BI.inherit(BI.Widget, {
this.layouts = BI.createWidget(BI.extend({element: this}, this._packageLayout(items)));
},
setEnable: function (b) {
BI.ButtonGroup.superclass.setEnable.apply(this, arguments);
BI.each(this.buttons, function (i, item) {
item.setEnable(b);
});
},
setNotSelectedValue: function (v) {
v = BI.isArray(v) ? v : [v];
BI.each(this.buttons, function (i, item) {

5
src/base/combination/group.combo.js

@ -83,11 +83,6 @@ BI.ComboGroup = BI.inherit(BI.Widget, {
})
},
setEnable: function (b) {
BI.ComboGroup.superclass.setEnable.apply(this, arguments);
this.combo && this.combo.setEnable(b);
},
getValue: function () {
return this.combo.getValue();
},

4
src/base/combination/loader.js

@ -195,10 +195,6 @@ BI.Loader = BI.inherit(BI.Widget, {
this.button_group.populate.apply(this.button_group, arguments);
},
setEnable: function (v) {
this.button_group.setEnable(v);
},
doBehavior: function () {
this.button_group.doBehavior.apply(this.button_group, arguments);
},

8
src/base/combination/switcher.js

@ -186,11 +186,9 @@ BI.Switcher = BI.inherit(BI.Widget, {
this.switcher.populate.apply(this.switcher, arguments);
},
setEnable: function (arg) {
BI.Switcher.superclass.setEnable.apply(this, arguments);
this.switcher && this.switcher.setEnable(arg);
this.popupView && this.popupView.setEnable(arg);
!arg && this._hideView();
_setEnable: function (arg) {
BI.Switcher.superclass._setEnable.apply(this, arguments);
!arg && this.isViewVisible() && this._hideView();
},
setValue: function (v) {

5
src/base/layer/layer.popup.js

@ -158,11 +158,6 @@ BI.PopupView = BI.inherit(BI.Widget, {
this.view.element.css({"max-height": (h - tbHeight - tabHeight - toolHeight - 2) + "px"})
},
setEnable: function (arg) {
BI.PopupView.superclass.setEnable.apply(this, arguments);
this.view && this.view.setEnable(arg);
},
setValue: function (selectedValues) {
this.tab && this.tab.setValue(selectedValues);
this.button_group.setValue(selectedValues);

4
src/base/single/button/button.basic.js

@ -298,8 +298,8 @@ BI.BasicButton = BI.inherit(BI.Single, {
return this.options.text;
},
setEnable: function (b) {
BI.BasicButton.superclass.setEnable.apply(this, arguments);
_setEnable: function (b) {
BI.BasicButton.superclass._setEnable.apply(this, arguments);
if (!b) {
if (this.options.shadow) {
this.$mask && this.$mask.setVisible(false);

6
src/base/single/button/buttons/button.js

@ -119,12 +119,6 @@
}
},
setEnable: function (b) {
BI.Button.superclass.setEnable.apply(this, arguments);
// this.text.setEnable(b);
// this.icon && this.icon.setEnable(b);
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},

4
src/base/single/editor/editor.code.js

@ -76,8 +76,8 @@ BI.CodeEditor = BI.inherit(BI.Single, {
}
},
setEnable: function (b) {
BI.CodeEditor.superclass.setEnable.apply(this, arguments);
_setEnable: function (b) {
BI.CodeEditor.superclass._setEnable.apply(this, arguments);
this.editor.setOption("readOnly", b === true ? false : "nocursor")
},

6
src/base/single/editor/editor.js

@ -303,12 +303,6 @@ BI.Editor = BI.inherit(BI.Single, {
isValid: function () {
return this.editor.isValid();
},
setEnable: function (b) {
BI.Editor.superclass.setEnable.apply(this, arguments);
this.editor && this.editor.setEnable(b);
this.watermark && this.watermark.setEnable(b);
}
});
BI.Editor.EVENT_CHANGE = "EVENT_CHANGE";

5
src/base/single/editor/editor.multifile.js

@ -79,11 +79,6 @@ BI.MultifileEditor = BI.inherit(BI.Single, {
reset: function () {
this.file.reset();
},
setEnable: function (enable) {
BI.MultiFile.superclass.setEnable.apply(this, arguments);
this.file.setEnable(enable);
}
});
BI.MultifileEditor.EVENT_CHANGE = "MultifileEditor.EVENT_CHANGE";

6
src/base/single/editor/editor.textarea.js

@ -153,12 +153,6 @@ BI.TextAreaEditor = BI.inherit(BI.Single, {
BI.TextAreaEditor.superclass.setValid.apply(this, arguments);
this.content.setValid(b);
this.watermark && this.watermark.setValid(b);
},
setEnable: function (b) {
BI.TextAreaEditor.superclass.setEnable.apply(this, arguments);
this.content.setEnable(b);
this.watermark && this.watermark.setEnable(b);
}
});
BI.TextAreaEditor.EVENT_CHANGE = "EVENT_CHANGE";

4
src/base/single/input/file.js

@ -601,8 +601,8 @@
this.wrap.attachNum = 0;
},
setEnable: function (enable) {
BI.File.superclass.setEnable.apply(this, arguments);
_setEnable: function (enable) {
BI.File.superclass._setEnable.apply(this, arguments);
if (enable === true) {
this.element.attr("disabled", "disabled");
} else {

4
src/base/single/input/input.js

@ -256,8 +256,8 @@ BI.Input = BI.inherit(BI.Single, {
}
},
setEnable: function (b) {
BI.Input.superclass.setEnable.apply(this, [b]);
_setEnable: function (b) {
BI.Input.superclass._setEnable.apply(this, [b]);
this.element[0].disabled = !b;
}
});

5
src/base/tree/customtree.js

@ -35,11 +35,6 @@ BI.CustomTree = BI.inherit(BI.Widget, {
this.initTree(this.options.items);
},
setEnable: function (v) {
BI.CustomTree.superclass.setEnable.apply(this, arguments);
this.tree.setEnable(v)
},
_formatItems: function (nodes) {
var self = this, o = this.options;
nodes = BI.Tree.transformToTreeFormat(nodes);

5
src/case/button/icon/icon.change.js

@ -77,11 +77,6 @@ BI.IconChangeButton = BI.inherit(BI.Single, {
this.element.removeClass(o.iconClass).addClass(cls);
o.iconClass = cls;
}
},
setEnable: function (b) {
BI.IconChangeButton.superclass.setEnable.apply(this, arguments);
this.button.setEnable(b);
}
});
BI.IconChangeButton.EVENT_CHANGE = "IconChangeButton.EVENT_CHANGE";

5
src/case/button/item.multiselect.js

@ -50,11 +50,6 @@ BI.MultiSelectItem = BI.inherit(BI.BasicButton, {
}))));
},
setEnable: function (v) {
BI.MultiSelectItem.superclass.setEnable.apply(this, arguments);
this.checkbox.setEnable(v);
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},

4
src/case/colorchooser/colorchooser.js

@ -70,10 +70,6 @@ BI.ColorChooser = BI.inherit(BI.Widget, {
return this.combo.isViewVisible();
},
setEnable: function (v) {
this.combo.setEnable(v)
},
setValue: function (color) {
this.combo.setValue(color);
},

4
src/case/combo/bubblecombo/combo.bubble.js

@ -201,10 +201,6 @@ BI.BubbleCombo = BI.inherit(BI.Widget, {
isViewVisible: function () {
return this.combo.isViewVisible();
},
setEnable: function (v) {
this.combo.setEnable(!!v);
}
});

5
src/case/combo/editoriconcheckcombo/combo.editoriconcheck.js

@ -62,11 +62,6 @@ BI.EditorIconCheckCombo = BI.inherit(BI.Widget, {
this.editorIconCheckCombo.setValue(v);
},
setEnable: function (v) {
BI.EditorIconCheckCombo.superclass.setEnable.apply(this, arguments);
this.editorIconCheckCombo.setEnable(v);
},
getValue: function () {
return this.trigger.getValue();
},

5
src/case/combo/iconcombo/combo.icon.js

@ -81,11 +81,6 @@ BI.IconCombo = BI.inherit(BI.Widget, {
this.iconCombo.setValue(v);
},
setEnable: function (v) {
BI.IconCombo.superclass.setEnable.apply(this, arguments);
this.iconCombo.setEnable(v);
},
getValue: function () {
return this.iconCombo.getValue();
},

5
src/case/combo/textvaluecheckcombo/combo.textvaluecheck.js

@ -56,11 +56,6 @@ BI.TextValueCheckCombo = BI.inherit(BI.Widget, {
this.textIconCheckCombo.setValue(v);
},
setEnable: function (v) {
BI.TextValueCheckCombo.superclass.setEnable.apply(this, arguments);
this.textIconCheckCombo.setEnable(v);
},
setWarningTitle: function (title) {
this.trigger.setWarningTitle(title);
},

5
src/case/combo/textvaluecheckcombo/combo.textvaluechecksmall.js

@ -51,11 +51,6 @@ BI.SmallTextValueCheckCombo = BI.inherit(BI.Widget, {
this.SmallTextIconCheckCombo.setValue(v);
},
setEnable: function (v) {
BI.SmallTextValueCheckCombo.superclass.setEnable.apply(this, arguments);
this.SmallTextIconCheckCombo.setEnable(v);
},
getValue: function () {
return this.SmallTextIconCheckCombo.getValue();
},

5
src/case/combo/textvaluecombo/combo.textvalue.js

@ -53,11 +53,6 @@ BI.TextValueCombo = BI.inherit(BI.Widget, {
this.textIconCombo.setValue(v);
},
setEnable: function (v) {
BI.TextValueCombo.superclass.setEnable.apply(this, arguments);
this.textIconCombo.setEnable(v);
},
getValue: function () {
return this.textIconCombo.getValue();
},

5
src/case/combo/textvaluecombo/combo.textvaluesmall.js

@ -53,11 +53,6 @@ BI.SmallTextValueCombo = BI.inherit(BI.Widget, {
this.SmallTextValueCombo.setValue(v);
},
setEnable: function (v) {
BI.SmallTextValueCombo.superclass.setEnable.apply(this, arguments);
this.SmallTextValueCombo.setEnable(v);
},
getValue: function () {
return this.SmallTextValueCombo.getValue();
},

5
src/case/combo/textvaluedownlistcombo/combo.textvaluedownlist.js

@ -64,11 +64,6 @@ BI.TextValueDownListCombo = BI.inherit(BI.Widget, {
this.trigger.setValue(v.childValue || v.value);
},
setEnable: function (v) {
BI.TextValueDownListCombo.superclass.setEnable.apply(this, arguments);
this.combo.setEnable(v);
},
getValue: function () {
var v = this.combo.getValue()[0];
return [v.childValue || v.value];

6
src/case/editor/editor.search.js

@ -168,12 +168,6 @@ BI.SearchEditor = BI.inherit(BI.Widget, {
isValid: function () {
return this.editor.isValid();
},
setEnable: function (b) {
BI.Editor.superclass.setEnable.apply(this, arguments);
this.editor && this.editor.setEnable(b);
this.clear.setEnable(b);
}
});
BI.SearchEditor.EVENT_CHANGE = "EVENT_CHANGE";

5
src/case/editor/editor.state.js

@ -201,11 +201,6 @@ BI.StateEditor = BI.inherit(BI.Widget, {
this.editor.setValue(k);
},
setEnable: function (v) {
this.text.setEnable(v);
this.editor.setEnable(v);
},
getValue: function () {
return this.editor.getValue();
},

5
src/case/editor/editor.state.simple.js

@ -199,11 +199,6 @@ BI.SimpleStateEditor = BI.inherit(BI.Widget, {
this.editor.setValue(k);
},
setEnable: function(v){
this.text.setEnable(v);
this.editor.setEnable(v);
},
getValue: function () {
return this.editor.getValue();
},

5
src/case/editor/editor.text.js

@ -141,11 +141,6 @@ BI.TextEditor = BI.inherit(BI.Widget, {
getValue: function () {
return this.editor.getValue();
},
setEnable: function (b) {
BI.Editor.superclass.setEnable.apply(this, arguments);
this.editor && this.editor.setEnable(b);
}
});
BI.TextEditor.EVENT_CHANGE = "EVENT_CHANGE";

4
src/case/segment/segment.js

@ -46,10 +46,6 @@ BI.Segment = BI.inherit(BI.Widget, {
this.buttonGroup.setEnabledValue(v);
},
setEnable: function (v) {
this.buttonGroup.setEnable(v);
},
getValue: function () {
return this.buttonGroup.getValue();
}

7
src/case/toolbar/toolbar.multiselect.js

@ -121,13 +121,6 @@ BI.MultiSelectBar = BI.inherit(BI.BasicButton, {
var isAllChecked = this.options.isAllCheckedBySelectedValue.apply(this, arguments);
this.setSelected(isAllChecked);
!isAllChecked && this.setHalfSelected(this.options.isHalfCheckedBySelectedValue.apply(this, arguments));
},
setEnable: function (b) {
BI.MultiSelectBar.superclass.setEnable.apply(this, arguments);
this.checkbox.setEnable(b);
this.half.setEnable(b);
this.text.setEnable(b);
}
});
BI.MultiSelectBar.EVENT_CHANGE = "MultiSelectBar.EVENT_CHANGE";

6
src/case/trigger/trigger.text.js

@ -48,12 +48,6 @@ BI.TextTrigger = BI.inherit(BI.Trigger, {
});
},
setEnable: function (v) {
BI.TextTrigger.superclass.setEnable.apply(this, arguments);
this.trigerButton.setEnable(v);
this.text.setEnable(v);
},
setValue: function (value) {
this.text.setValue(value);
this.text.setTitle(value);

6
src/case/trigger/trigger.text.small.js

@ -47,12 +47,6 @@ BI.SmallTextTrigger = BI.inherit(BI.Trigger, {
});
},
setEnable: function (v) {
BI.SmallTextTrigger.superclass.setEnable.apply(this, arguments);
this.trigerButton.setEnable(v);
this.text.setEnable(v);
},
setValue: function (value) {
this.text.setValue(value);
},

35
src/core/widget.js

@ -105,17 +105,18 @@ BI.Widget = BI.inherit(BI.OB, {
_initVisualEffects: function () {
var o = this.options;
if (o.invisible) {
this.element.hide();
//用display属性做显示和隐藏,否则jquery会在显示时将display设为block会覆盖掉display:flex属性
this.element.css("display", "none");
}
if (o.disabled || o.invalid) {
BI.nextTick(BI.bind(function () {
if (this.options.disabled) {
this.setEnable(false);
}
if (this.options.invalid) {
this.setValid(false);
}
}, this));
// BI.nextTick(BI.bind(function () {
if (this.options.disabled) {
this.setEnable(false);
}
if (this.options.invalid) {
this.setValid(false);
}
// }, this));
}
},
@ -163,6 +164,7 @@ BI.Widget = BI.inherit(BI.OB, {
this._isMounted = true;
this._mountChildren && this._mountChildren();
BI.each(this._children, function (i, widget) {
!self.isEnabled() && widget._setEnable(false);
widget._mount && widget._mount();
});
this.mounted && this.mounted();
@ -184,12 +186,23 @@ BI.Widget = BI.inherit(BI.OB, {
this._initElementHeight();
},
setEnable: function (enable) {
_setEnable: function (enable) {
if (enable === true) {
this.options.disabled = false;
this.element.removeClass("base-disabled disabled");
} else if (enable === false) {
this.options.disabled = true;
}
//递归将所有子组件使能
BI.each(this._children, function (i, child) {
child._setEnable && child._setEnable(enable);
});
},
setEnable: function (enable) {
this._setEnable(enable);
if (enable === true) {
this.element.removeClass("base-disabled disabled");
} else if (enable === false) {
this.element.addClass("base-disabled disabled");
}
},

4
src/css/core/utils/common.css

@ -125,8 +125,8 @@
}
.bi-z-index-mask {
color: #ffffff;
background-color: rgba(26, 26, 26, 0.3);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#4d1a1a1a,endColorstr=#4d1a1a1a);
background-color: rgba(26, 26, 26, 0.5);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#801a1a1a,endColorstr=#801a1a1a);
}
.bi-list-item:hover,
.bi-list-item.hover {

2
src/less/core/utils/common.less

@ -175,7 +175,7 @@
.bi-z-index-mask {
color: @color-bi-background-default;
.background-color(@color-bi-background-black, 30%);
.background-color(@color-bi-background-black, 50%);
}
//只有背景变化

4
src/widget/multiselect/multiselect.loader.js

@ -155,10 +155,6 @@ BI.MultiSelectLoader = BI.inherit(BI.Widget, {
this.button_group.populate.apply(this.button_group, arguments);
},
setEnable: function (arg) {
this.button_group.setEnable(arg);
},
resetHeight: function (h) {
this.button_group.resetHeight(h);
},

4
src/widget/multiselect/multiselect.popup.view.js

@ -74,10 +74,6 @@ BI.MultiSelectPopupView = BI.inherit(BI.Widget, {
this.popupView.populate.apply(this.popupView, arguments);
},
setEnable: function (arg) {
this.popupView.setEnable(arg);
},
resetHeight: function (h) {
this.popupView.resetHeight(h);
},

4
src/widget/multiselect/multiselect.trigger.js

@ -133,10 +133,6 @@ BI.MultiSelectTrigger = BI.inherit(BI.Trigger, {
this.numberCounter.setValue(ob);
},
setEnable: function (v) {
this.searcher.setEnable(v);
},
getKey: function () {
return this.searcher.getKey();
},

4
src/widget/multiselect/search/multiselect.search.loader.js

@ -139,10 +139,6 @@ BI.MultiSelectSearchLoader = BI.inherit(BI.Widget, {
this.button_group.populate.apply(this.button_group, arguments);
},
setEnable: function (arg) {
this.button_group.setEnable(arg);
},
resetHeight: function (h) {
this.button_group.resetHeight(h);
},

4
src/widget/multiselect/trigger/editor.multiselect.js

@ -56,10 +56,6 @@ BI.MultiSelectEditor = BI.inherit(BI.Widget, {
this.editor.setValue(v);
},
setEnable: function(v){
this.editor.setEnable(v);
},
getValue: function () {
var v = this.editor.getState();
if (BI.isArray(v) && v.length > 0) {

4
src/widget/multiselect/trigger/searcher.multiselect.js

@ -134,10 +134,6 @@ BI.MultiSelectSearcher = BI.inherit(BI.Widget, {
return this.searcher.getValue();
},
setEnable: function (v) {
this.editor.setEnable(v);
},
populate: function (items) {
this.searcher.populate.apply(this.searcher, arguments);
}

5
src/widget/multistringlist/multistringlist.js

@ -287,11 +287,6 @@ BI.MultiStringList = BI.inherit(BI.Widget, {
this.trigger.getSearcher().adjustView();
},
setEnable: function (v) {
this.trigger.setEnable(v);
this.popup.setEnable(v);
},
setValue: function (v) {
this.storeValue = v || {};
this._assertValue(this.storeValue);

4
src/widget/multitree/multi.tree.combo.js

@ -236,10 +236,6 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
this.combo.hideView();
},
setEnable: function (v) {
this.combo.setEnable(v);
},
setValue: function (v) {
this.storeValue.value = v || {};
this.combo.setValue({

4
src/widget/multitree/multi.tree.popup.js

@ -79,10 +79,6 @@ BI.MultiTreePopup = BI.inherit(BI.Pane, {
return this.tree.hasChecked();
},
setEnable: function (arg) {
this.popupView.setEnable(arg);
},
resetHeight: function (h) {
this.popupView.resetHeight(h);
},

4
src/widget/multitree/trigger/searcher.multi.tree.js

@ -119,10 +119,6 @@ BI.MultiTreeSearcher = BI.inherit(BI.Widget, {
return this.editor.getValue();
},
setEnable: function(v){
this.editor.setEnable(v);
},
getValue: function () {
return this.searcher.getValue();
},

5
src/widget/multitreelist/multitreelist.js

@ -150,11 +150,6 @@ BI.MultiTreeList = BI.inherit(BI.Widget, {
this.trigger.getSearcher().adjustView();
},
setEnable: function (v) {
this.trigger.setEnable(v);
this.popup.setEnable(v);
},
setValue: function (v) {
this.storeValue.value = v || {};
this.popup.setValue({

7
src/widget/numericalinterval/numericalinterval.js

@ -430,13 +430,6 @@ BI.NumericalInterval = BI.inherit(BI.Single, {
return this.options.validation === "valid";
},
setEnable: function (b) {
this.smallEditor.setEnable(b);
this.smallCombo.setEnable(b);
this.bigEditor.setEnable(b);
this.bigCombo.setEnable(b);
},
setMinEnable: function (b) {
this.smallEditor.setEnable(b);
},

Loading…
Cancel
Save