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