From ae119fd9c3544c87831b030e2a2845e15e975e21 Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 21 Jan 2022 20:06:52 +0800 Subject: [PATCH] =?UTF-8?q?feature:=20=E5=B0=8F=E4=B8=89=E8=A7=92=E6=8D=A2?= =?UTF-8?q?=E4=B8=80=E7=A7=8D=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/combination/bubble.js | 2 +- src/base/combination/combo.js | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/base/combination/bubble.js b/src/base/combination/bubble.js index 5177f3020..47c067e20 100644 --- a/src/base/combination/bubble.js +++ b/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); diff --git a/src/base/combination/combo.js b/src/base/combination/combo.js index 52e9df59a..2019dd756 100644 --- a/src/base/combination/combo.js +++ b/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);