Browse Source

Pull request #2442: feature: 气泡支持品牌色

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

* commit 'e1257d17e977e710008be06b4f267d41f3398ac1':
  feature: 气泡支持品牌色
es6
guy 3 years ago
parent
commit
7ec7430da7
  1. 39
      src/case/combo/bubblecombo/popup.bubble.js

39
src/case/combo/bubblecombo/popup.bubble.js

@ -13,7 +13,7 @@ BI.BubblePopupView = BI.inherit(BI.PopupView, {
maxWidth: 300, maxWidth: 300,
minHeight: 50 minHeight: 50
}); });
}, }
}); });
BI.shortcut("bi.bubble_popup_view", BI.BubblePopupView); BI.shortcut("bi.bubble_popup_view", BI.BubblePopupView);
@ -47,33 +47,36 @@ BI.BubblePopupBarView = BI.inherit(BI.BubblePopupView, {
var items = []; var items = [];
BI.each(o.buttons, function (i, buttonOpt) { BI.each(o.buttons, function (i, buttonOpt) {
if (BI.isWidget(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 { } else {
items.push(BI.extend({ items.push({
type: "bi.button", el: BI.extend({
height: 24, type: "bi.button",
handler: function (v) { height: 24,
self.fireEvent(BI.BubblePopupBarView.EVENT_CLICK_TOOLBAR_BUTTON, v); handler: function (v) {
} self.fireEvent(BI.BubblePopupBarView.EVENT_CLICK_TOOLBAR_BUTTON, v);
}, buttonOpt)); }
}, buttonOpt),
lgap: i === 0 ? 20 : 15,
rgap: i === o.buttons.length - 1 ? 20 : 0
});
} }
}); });
return BI.createWidget({ return BI.createWidget({
type: "bi.center", type: "bi.right_vertical_adapt",
height: 54, height: 54,
rgap: 20, items: items
items: [{
type: "bi.right_vertical_adapt",
lgap: 15,
items: items
}]
}); });
}, },
_createView: function () { _createView: function () {
var o = this.options; var o = this.options;
var button = BI.createWidget({ var button = BI.createWidget({
type: "bi.button_group", type: "bi.button_group",
items: [o.el], items: [o.el],
layouts: [{ layouts: [{
@ -156,7 +159,7 @@ BI.TextBubblePopupBarView = BI.inherit(BI.Widget, {
populate: function (v) { populate: function (v) {
this.text.setText(v || this.options.text); this.text.setText(v || this.options.text);
}, }
}); });
BI.TextBubblePopupBarView.EVENT_CHANGE = "EVENT_CLICK_TOOLBAR_BUTTON"; BI.TextBubblePopupBarView.EVENT_CHANGE = "EVENT_CLICK_TOOLBAR_BUTTON";
BI.shortcut("bi.text_bubble_bar_popup_view", BI.TextBubblePopupBarView); BI.shortcut("bi.text_bubble_bar_popup_view", BI.TextBubblePopupBarView);

Loading…
Cancel
Save