From 4d11ab22f361dce17932979dac33a837d41eecf2 Mon Sep 17 00:00:00 2001 From: guy Date: Thu, 27 Aug 2020 13:17:38 +0800 Subject: [PATCH 1/2] bugfix --- src/core/wrapper/layout/adapt/adapt.horizontal.js | 7 +++---- src/core/wrapper/layout/adapt/adapt.table.js | 6 +++--- src/core/wrapper/layout/adapt/inline.vertical.js | 6 +++--- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/core/wrapper/layout/adapt/adapt.horizontal.js b/src/core/wrapper/layout/adapt/adapt.horizontal.js index 6c40432ee..224422a45 100644 --- a/src/core/wrapper/layout/adapt/adapt.horizontal.js +++ b/src/core/wrapper/layout/adapt/adapt.horizontal.js @@ -8,7 +8,6 @@ BI.HorizontalAdaptLayout = BI.inherit(BI.Layout, { return BI.extend(BI.HorizontalAdaptLayout.superclass.props.apply(this, arguments), { baseCls: "bi-horizontal-adapt-layout", verticalAlign: BI.VerticalAlign.Top, - horizontalAlign: BI.HorizontalAlign.Center, columnSize: [], scrollx: false, hgap: 0, @@ -24,8 +23,8 @@ BI.HorizontalAdaptLayout = BI.inherit(BI.Layout, { BI.HorizontalAdaptLayout.superclass.render.apply(this, arguments); return { type: "bi.horizontal", - verticalAlign: BI.VerticalAlign.Top, - horizontalAlign: o.horizontalAlign, + verticalAlign: o.verticalAlign, + horizontalAlign: BI.HorizontalAlign.Stretch, columnSize: o.columnSize, items: o.items, scrollx: o.scrollx, @@ -49,4 +48,4 @@ BI.HorizontalAdaptLayout = BI.inherit(BI.Layout, { this.layout.populate.apply(this, arguments); } }); -BI.shortcut("bi.horizontal_adapt", BI.HorizontalAdaptLayout); \ No newline at end of file +BI.shortcut("bi.horizontal_adapt", BI.HorizontalAdaptLayout); diff --git a/src/core/wrapper/layout/adapt/adapt.table.js b/src/core/wrapper/layout/adapt/adapt.table.js index ffd565504..528432bb5 100644 --- a/src/core/wrapper/layout/adapt/adapt.table.js +++ b/src/core/wrapper/layout/adapt/adapt.table.js @@ -25,8 +25,8 @@ BI.TableAdaptLayout = BI.inherit(BI.Layout, { this.$table = BI.Widget._renderEngine.createElement("
").css({ position: "relative", display: "table", - height: o.verticalAlign === BI.VerticalAlign.Middle ? "100%" : "auto", - width: o.horizontalAlign === BI.HorizontalAlign.Center ? "100%" : "auto", + width: (o.horizontalAlign === BI.HorizontalAlign.Center || BI.HorizontalAlign.Stretch) ? "100%" : "auto", + height: (o.verticalAlign === BI.VerticalAlign.Middle || o.verticalAlign === BI.VerticalAlign.Stretch) ? "100%" : "auto", "white-space": "nowrap" }); this.populate(this.options.items); @@ -103,4 +103,4 @@ BI.TableAdaptLayout = BI.inherit(BI.Layout, { this._mount(); } }); -BI.shortcut("bi.table_adapt", BI.TableAdaptLayout); \ No newline at end of file +BI.shortcut("bi.table_adapt", BI.TableAdaptLayout); diff --git a/src/core/wrapper/layout/adapt/inline.vertical.js b/src/core/wrapper/layout/adapt/inline.vertical.js index 24736f8e6..453eaa531 100644 --- a/src/core/wrapper/layout/adapt/inline.vertical.js +++ b/src/core/wrapper/layout/adapt/inline.vertical.js @@ -18,7 +18,7 @@ BI.InlineVerticalAdaptLayout = BI.inherit(BI.Layout, { rgap: 0, tgap: 0, bgap: 0, - horizontalAlign: "left" + horizontalAlign: BI.HorizontalAlign.Left }); }, @@ -29,7 +29,7 @@ BI.InlineVerticalAdaptLayout = BI.inherit(BI.Layout, { whiteSpace: "nowrap", textAlign: o.horizontalAlign }); - this.populate(this.options.items); + this.populate(o.items); }, _addElement: function (i, item) { @@ -47,7 +47,7 @@ BI.InlineVerticalAdaptLayout = BI.inherit(BI.Layout, { } if (o.hgap + o.lgap + (item.lgap || 0) + (item.hgap || 0) !== 0) { w.element.css({ - "margin-left": (i === 0 ? o.hgap : 0) + o.lgap + (item.lgap || 0) + (item.hgap || 0) +"px" + "margin-left": (i === 0 ? o.hgap : 0) + o.lgap + (item.lgap || 0) + (item.hgap || 0) + "px" }); } if (o.hgap + o.rgap + (item.rgap || 0) + (item.hgap || 0) !== 0) { From 7c77b249040f571d4c1560df76c9dcb1a42ddecf Mon Sep 17 00:00:00 2001 From: guy Date: Thu, 27 Aug 2020 13:19:02 +0800 Subject: [PATCH 2/2] bugfix --- src/core/wrapper/layout/adapt/inline.center.js | 5 +++-- src/core/wrapper/layout/adapt/inline.vertical.js | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/core/wrapper/layout/adapt/inline.center.js b/src/core/wrapper/layout/adapt/inline.center.js index dd5c79139..0dec3583b 100644 --- a/src/core/wrapper/layout/adapt/inline.center.js +++ b/src/core/wrapper/layout/adapt/inline.center.js @@ -12,6 +12,7 @@ BI.InlineCenterAdaptLayout = BI.inherit(BI.Layout, { props: function () { return BI.extend(BI.InlineLayout.superclass.props.apply(this, arguments), { baseCls: "bi-inline-center-adapt-layout", + horizontalAlign: BI.HorizontalAlign.Center, hgap: 0, vgap: 0, lgap: 0, @@ -25,7 +26,7 @@ BI.InlineCenterAdaptLayout = BI.inherit(BI.Layout, { BI.InlineCenterAdaptLayout.superclass.render.apply(this, arguments); this.element.css({ whiteSpace: "nowrap", - textAlign: "center" + textAlign: o.horizontalAlign }); this.populate(this.options.items); }, @@ -83,4 +84,4 @@ BI.InlineCenterAdaptLayout = BI.inherit(BI.Layout, { this._mount(); } }); -BI.shortcut("bi.inline_center_adapt", BI.InlineCenterAdaptLayout); \ No newline at end of file +BI.shortcut("bi.inline_center_adapt", BI.InlineCenterAdaptLayout); diff --git a/src/core/wrapper/layout/adapt/inline.vertical.js b/src/core/wrapper/layout/adapt/inline.vertical.js index 453eaa531..17bb7ccab 100644 --- a/src/core/wrapper/layout/adapt/inline.vertical.js +++ b/src/core/wrapper/layout/adapt/inline.vertical.js @@ -12,13 +12,13 @@ BI.InlineVerticalAdaptLayout = BI.inherit(BI.Layout, { props: function () { return BI.extend(BI.InlineLayout.superclass.props.apply(this, arguments), { baseCls: "bi-inline-vertical-adapt-layout", + horizontalAlign: BI.HorizontalAlign.Left, hgap: 0, vgap: 0, lgap: 0, rgap: 0, tgap: 0, - bgap: 0, - horizontalAlign: BI.HorizontalAlign.Left + bgap: 0 }); },