Browse Source

feature: 小三角换一种实现

es6
guy 3 years ago
parent
commit
ae119fd9c3
  1. 2
      src/base/combination/bubble.js
  2. 22
      src/base/combination/combo.js

2
src/base/combination/bubble.js

@ -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);

22
src/base/combination/combo.js

@ -106,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