diff --git a/src/base/layer/layer.popover.js b/src/base/layer/layer.popover.js index cc18fa06e..646758527 100644 --- a/src/base/layer/layer.popover.js +++ b/src/base/layer/layer.popover.js @@ -13,20 +13,22 @@ BI.Popover = BI.inherit(BI.Widget, { MAX_HEIGHT: 600 }, - props: { - baseCls: "bi-popover bi-card bi-border-radius", - size: "normal", // small, normal, big - logic: { - dynamic: false - }, - header: null, - headerHeight: 40, - body: null, - footer: null, - footerHeight: 44, - closable: true, // BI-40839 是否显示右上角的关闭按钮 - bodyHgap: 20, - bodyTgap: 10 + props: function () { + return { + baseCls: "bi-popover bi-card bi-border-radius", + size: "normal", // small, normal, big + logic: { + dynamic: false + }, + header: null, + headerHeight: 40, + body: null, + footer: null, + footerHeight: 44, + closable: true, // BI-40839 是否显示右上角的关闭按钮 + bodyHgap: BI.SIZE_CONSANTS.H_GAP_SIZE, + bodyTgap: 10 + }; }, render: function () { @@ -73,8 +75,8 @@ BI.Popover = BI.inherit(BI.Widget, { title: o.header, textAlign: "left" }, - left: 20, - right: o.closable ? 0 : 20 + left: BI.SIZE_CONSANTS.H_GAP_SIZE, + right: o.closable ? 0 : BI.SIZE_CONSANTS.H_GAP_SIZE }] } }, o.closable ? { @@ -127,9 +129,9 @@ BI.Popover = BI.inherit(BI.Widget, { type: "bi.absolute", items: [{ el: o.footer, - left: 20, + left: BI.SIZE_CONSANTS.H_GAP_SIZE, top: 0, - right: 20, + right: BI.SIZE_CONSANTS.H_GAP_SIZE, bottom: 0 }], height: o.footerHeight diff --git a/src/case/combo/bubblecombo/popup.bubble.js b/src/case/combo/bubblecombo/popup.bubble.js index 92311b725..fdcba8144 100644 --- a/src/case/combo/bubblecombo/popup.bubble.js +++ b/src/case/combo/bubblecombo/popup.bubble.js @@ -82,8 +82,8 @@ BI.BubblePopupBarView = BI.inherit(BI.BubblePopupView, { layouts: [{ type: "bi.vertical", cls: "bar-popup-container", - hgap: 20, - tgap: 15 + hgap: BI.SIZE_CONSANTS.H_GAP_SIZE, + tgap: BI.SIZE_CONSANTS.V_GAP_SIZE }] }); diff --git a/src/core/system.js b/src/core/system.js index 5dfe3a0a5..823195f86 100644 --- a/src/core/system.js +++ b/src/core/system.js @@ -16,9 +16,18 @@ LIST_ITEM_HEIGHT: 24, TRIGGER_HEIGHT: 24, TOAST_TOP: 10, + H_GAP_SIZE: "M", + V_GAP_SIZE: "M" } }; + // 具体尺寸还没定,先写着 + var sizeMap = { + "S": 16, + "M" : 20, + "L": 24 + }; + var provider = function () { this.SYSTEM = system; @@ -50,7 +59,14 @@ return BI.inherit(BI.OB, { getSize: function () { - return system.size; + var size = system.size; + var H_GAP_SIZE = sizeMap[size.H_GAP_SIZE]; + var V_GAP_SIZE = sizeMap[size.V_GAP_SIZE]; + + return BI.extend({}, size, { + H_GAP_SIZE: H_GAP_SIZE, + V_GAP_SIZE: V_GAP_SIZE + }); }, getResponsiveMode: function () {