Browse Source

Pull request #2449: feature: 小三角换一种实现

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

* commit 'ae119fd9c3544c87831b030e2a2845e15e975e21':
  feature: 小三角换一种实现
  feature: 小三角换一种实现
es6
guy 3 years ago
parent
commit
c80d1d76c4
  1. 4
      src/base/combination/bubble.js
  2. 23
      src/base/combination/combo.js

4
src/base/combination/bubble.js

@ -22,7 +22,7 @@
isDefaultInit: false,
destroyWhenHide: false,
hideWhenClickOutside: true,
showArrow: false,
showArrow: true,
hideWhenBlur: false,
isNeedAdjustHeight: true, // 是否需要高度调整
isNeedAdjustWidth: true,
@ -321,7 +321,7 @@
this._assertPopupViewRender();
this.fireEvent(BI.Bubble.EVENT_BEFORE_POPUPVIEW);
// popupVisible是为了获取其宽高, 放到可视范围之外以防止在IE下闪一下
this.popupView.css({left: -999999999, top: -99999999});
// this.popupView.css({left: -999999999, top: -99999999});
this.popupView.visible();
this.adjustWidth(e);

23
src/base/combination/combo.js

@ -28,6 +28,7 @@
hideWhenBlur: true,
hideWhenAnotherComboOpen: false,
hideWhenClickOutside: true,
showArrow: false,
isNeedAdjustHeight: true, // 是否需要高度调整
isNeedAdjustWidth: true,
stopEvent: false,
@ -105,6 +106,28 @@
});
},
_assertPopupView: function () {
var self = this, o = this.options;
if (this.popupView == null) {
this.popupView = BI.createWidget(this.options.popup, {
type: "bi.popup_view",
showArrow: o.showArrow,
value: o.value
}, this);
this.popupView.on(BI.Controller.EVENT_CHANGE, function (type, value, obj) {
if (type === BI.Events.CLICK) {
self.combo.setValue(self.getValue());
self.fireEvent(BI.Bubble.EVENT_CHANGE, value, obj);
}
self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
});
this.popupView.setVisible(false);
BI.nextTick(function () {
self.fireEvent(BI.Bubble.EVENT_AFTER_INIT);
});
}
},
_hideView: function (e) {
var o = this.options;
this.fireEvent(BI.Combo.EVENT_BEFORE_HIDEVIEW);

Loading…
Cancel
Save