Browse Source

Pull request #1388: combo中加一个属性

Merge in VISUAL/fineui from ~GUY/fineui:master to master

* commit 'd80c0c7696e8819fafe76d38b39aa1b18cf0faaa':
  增加一个可以外部暴露的方法
es6
guy 4 years ago
parent
commit
318a2d87a1
  1. 11
      src/base/combination/combo.js

11
src/base/combination/combo.js

@ -1,3 +1,5 @@
!(function () {
var needHideWhenAnotherComboOpen = {};
/**
* @class BI.Combo
* @extends BI.Widget
@ -16,6 +18,7 @@ BI.Combo = BI.inherit(BI.Widget, {
container: null, // popupview放置的容器,默认为this.element
isDefaultInit: false,
destroyWhenHide: false,
hideWhenAnotherComboOpen: false,
isNeedAdjustHeight: true, // 是否需要高度调整
isNeedAdjustWidth: true,
stopEvent: false,
@ -291,6 +294,7 @@ BI.Combo = BI.inherit(BI.Widget, {
this.popupView && this.popupView.invisible();
}
this.element.removeClass(this.options.comboClass);
delete needHideWhenAnotherComboOpen[this.getName()];
BI.Widget._renderEngine.createElement(document).unbind("mousedown." + this.getName()).unbind("mousewheel." + this.getName());
this.fireEvent(BI.Combo.EVENT_AFTER_HIDEVIEW);
@ -301,6 +305,11 @@ BI.Combo = BI.inherit(BI.Widget, {
this.fireEvent(BI.Combo.EVENT_BEFORE_POPUPVIEW);
this.popupView.visible();
BI.each(needHideWhenAnotherComboOpen, function(i, combo){
combo && combo.hideView();
});
needHideWhenAnotherComboOpen = {};
this.options.hideWhenAnotherComboOpen && (needHideWhenAnotherComboOpen[this.getName()] = this);
this.adjustWidth(e);
this.adjustHeight(e);
@ -519,6 +528,7 @@ BI.Combo = BI.inherit(BI.Widget, {
.unbind("mouseleave." + this.getName());
BI.Resizers.remove(this.getName());
this.popupView && this.popupView._destroy();
delete needHideWhenAnotherComboOpen[this.getName()];
}
});
BI.Combo.EVENT_TRIGGER_CHANGE = "EVENT_TRIGGER_CHANGE";
@ -534,3 +544,4 @@ BI.Combo.EVENT_BEFORE_HIDEVIEW = "EVENT_BEFORE_HIDEVIEW";
BI.Combo.EVENT_AFTER_HIDEVIEW = "EVENT_AFTER_HIDEVIEW";
BI.shortcut("bi.combo", BI.Combo);
}());

Loading…
Cancel
Save