From 77c20346c794b5614817424a1d4ae88a42ce17f4 Mon Sep 17 00:00:00 2001 From: guy Date: Thu, 24 Feb 2022 20:37:56 +0800 Subject: [PATCH 1/2] =?UTF-8?q?chore=EF=BC=9A=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E4=B8=80=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/case/combo/bubblecombo/popup.bubble.js | 64 +++++----------------- 1 file changed, 14 insertions(+), 50 deletions(-) diff --git a/src/case/combo/bubblecombo/popup.bubble.js b/src/case/combo/bubblecombo/popup.bubble.js index 6fa095726..cbd4479cd 100644 --- a/src/case/combo/bubblecombo/popup.bubble.js +++ b/src/case/combo/bubblecombo/popup.bubble.js @@ -39,9 +39,7 @@ BI.BubblePopupBarView = BI.inherit(BI.BubblePopupView, { }] }); }, - _init: function () { - BI.BubblePopupBarView.superclass._init.apply(this, arguments); - }, + _createToolBar: function () { var o = this.options, self = this; @@ -74,12 +72,16 @@ BI.BubblePopupBarView = BI.inherit(BI.BubblePopupView, { }); }, + _createContent: function () { + return this.options.el; + }, + _createView: function () { var o = this.options; var button = BI.createWidget({ type: "bi.button_group", - items: [o.el], + items: [this._createContent()], layouts: [{ type: "bi.vertical", cls: "bar-popup-container", @@ -102,66 +104,28 @@ BI.shortcut("bi.bubble_bar_popup_view", BI.BubblePopupBarView); * @class BI.TextBubblePopupBarView * @extends BI.BubblePopupView */ -BI.TextBubblePopupBarView = BI.inherit(BI.Widget, { +BI.TextBubblePopupBarView = BI.inherit(BI.BubblePopupBarView, { props: function () { return { baseCls: "bi-text-bubble-bar-popup-view", text: "", - buttons: [{ - level: "ignore", - value: false, - stopPropagation: true, - text: BI.i18nText("BI-Basic_Cancel") - }, { - value: true, - stopPropagation: true, - text: BI.i18nText("BI-Basic_OK") - }] }; }, - render: function () { + _createContent: function () { var self = this, o = this.options; - var buttons = BI.map(o.buttons, function (index, buttonOpt) { - if (BI.isWidget(buttonOpt)) { - return buttonOpt; - } - return BI.extend({ - type: "bi.button", - height: 24, - handler: function (v) { - self.fireEvent(BI.TextBubblePopupBarView.EVENT_CHANGE, v); - } - }, buttonOpt); - - }); return { - type: "bi.bubble_bar_popup_view", - primary: o.primary, - showArrow: o.showArrow, - minWidth: o.minWidth, - maxWidth: o.maxWidth, - minHeight: o.minHeight, + type: "bi.label", + text: o.text, + whiteSpace: "normal", + textAlign: "left", ref: function () { - self.popup = this; - }, - el: { - type: "bi.label", - text: o.text, - whiteSpace: "normal", - textAlign: "left", - ref: function () { - self.text = this; - } - }, - buttons: buttons + self.text = this; + } }; }, - setDirection: function (direction, position) { - this.popup.setDirection(direction, position); - }, populate: function (v) { this.text.setText(v || this.options.text); } From 4924f09d15d06c90198428de8bfaddb5fae4a2a4 Mon Sep 17 00:00:00 2001 From: guy Date: Thu, 24 Feb 2022 21:35:58 +0800 Subject: [PATCH 2/2] =?UTF-8?q?chore=EF=BC=9A=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E4=B8=80=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/case/combo/bubblecombo/popup.bubble.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/case/combo/bubblecombo/popup.bubble.js b/src/case/combo/bubblecombo/popup.bubble.js index cbd4479cd..d41767996 100644 --- a/src/case/combo/bubblecombo/popup.bubble.js +++ b/src/case/combo/bubblecombo/popup.bubble.js @@ -106,11 +106,12 @@ BI.shortcut("bi.bubble_bar_popup_view", BI.BubblePopupBarView); */ BI.TextBubblePopupBarView = BI.inherit(BI.BubblePopupBarView, { - props: function () { - return { - baseCls: "bi-text-bubble-bar-popup-view", + _defaultConfig: function () { + var config = BI.TextBubblePopupBarView.superclass._defaultConfig.apply(this, arguments); + return BI.extend(config, { + baseCls: config.baseCls + " bi-text-bubble-bar-popup-view", text: "", - }; + }); }, _createContent: function () {