From 2cf6e2ec5eb294949a1cd72723479d632e85eb2b Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 21 Jan 2022 15:27:33 +0800 Subject: [PATCH] =?UTF-8?q?feature:=20=E6=B0=94=E6=B3=A1=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E5=93=81=E7=89=8C=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/case/combo/bubblecombo/popup.bubble.js | 39 ++++++++++++---------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/src/case/combo/bubblecombo/popup.bubble.js b/src/case/combo/bubblecombo/popup.bubble.js index cbb15070a..d823651fe 100644 --- a/src/case/combo/bubblecombo/popup.bubble.js +++ b/src/case/combo/bubblecombo/popup.bubble.js @@ -13,7 +13,7 @@ BI.BubblePopupView = BI.inherit(BI.PopupView, { maxWidth: 300, minHeight: 50 }); - }, + } }); BI.shortcut("bi.bubble_popup_view", BI.BubblePopupView); @@ -47,33 +47,36 @@ BI.BubblePopupBarView = BI.inherit(BI.BubblePopupView, { var items = []; BI.each(o.buttons, function (i, buttonOpt) { if (BI.isWidget(buttonOpt)) { - items.push(buttonOpt); + items.push({ + el: buttonOpt, + lgap: i === 0 ? 20 : 15, + rgap: i === o.buttons.length - 1 ? 20 : 0 + }); } else { - items.push(BI.extend({ - type: "bi.button", - height: 24, - handler: function (v) { - self.fireEvent(BI.BubblePopupBarView.EVENT_CLICK_TOOLBAR_BUTTON, v); - } - }, buttonOpt)); + items.push({ + el: BI.extend({ + type: "bi.button", + height: 24, + handler: function (v) { + self.fireEvent(BI.BubblePopupBarView.EVENT_CLICK_TOOLBAR_BUTTON, v); + } + }, buttonOpt), + lgap: i === 0 ? 20 : 15, + rgap: i === o.buttons.length - 1 ? 20 : 0 + }); } }); return BI.createWidget({ - type: "bi.center", + type: "bi.right_vertical_adapt", height: 54, - rgap: 20, - items: [{ - type: "bi.right_vertical_adapt", - lgap: 15, - items: items - }] + items: items }); }, _createView: function () { var o = this.options; - var button = BI.createWidget({ + var button = BI.createWidget({ type: "bi.button_group", items: [o.el], layouts: [{ @@ -156,7 +159,7 @@ BI.TextBubblePopupBarView = BI.inherit(BI.Widget, { populate: function (v) { this.text.setText(v || this.options.text); - }, + } }); BI.TextBubblePopupBarView.EVENT_CHANGE = "EVENT_CLICK_TOOLBAR_BUTTON"; BI.shortcut("bi.text_bubble_bar_popup_view", BI.TextBubblePopupBarView);