From 633fbe96b9f7dcb9c8a98456de3bff91d3dbb426 Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 28 Aug 2020 10:06:32 +0800 Subject: [PATCH 1/2] bugfix --- src/core/platform/web/config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/platform/web/config.js b/src/core/platform/web/config.js index ee604d440..b2d882b15 100644 --- a/src/core/platform/web/config.js +++ b/src/core/platform/web/config.js @@ -23,7 +23,7 @@ BI.prepares.push(function () { if (ob.horizontalAlign === BI.HorizontalAlign.Center || ob.horizontalAlign === BI.HorizontalAlign.Stretch) { return BI.extend(ob, {type: "bi.table_adapt"}); } - if (!IE && supportFlex) { + if (!isIE && supportFlex) { return BI.extend(ob, {type: "bi.flex_horizontal"}); } // 解决使用inline_vertical_adapt的顺序问题 From 3fee0b4497f269d22be307a340dc0cf354a21d7d Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 28 Aug 2020 11:54:21 +0800 Subject: [PATCH 2/2] bugfix --- src/base/single/label/abstract.label.js | 7 ------- src/core/wrapper/layout/flex/flex.horizontal.js | 8 ++++++-- src/core/wrapper/layout/flex/flex.vertical.js | 8 ++++++-- .../layout/flex/wrapper/flex.wrapper.horizontal.js | 8 ++++++-- .../wrapper/layout/flex/wrapper/flex.wrapper.vertical.js | 8 ++++++-- 5 files changed, 24 insertions(+), 15 deletions(-) diff --git a/src/base/single/label/abstract.label.js b/src/base/single/label/abstract.label.js index ca76dd49b..2dc09c826 100644 --- a/src/base/single/label/abstract.label.js +++ b/src/base/single/label/abstract.label.js @@ -2,13 +2,6 @@ * Created by dailer on 2019/6/19. */ !(function () { - var _isSupportFlex; - var isSupportFlex = function () { - if (_isSupportFlex == null) { - _isSupportFlex = !!(BI.isSupportCss3 && BI.isSupportCss3("flex")); - } - return _isSupportFlex; - }; BI.AbstractLabel = BI.inherit(BI.Single, { _defaultConfig: function (props) { diff --git a/src/core/wrapper/layout/flex/flex.horizontal.js b/src/core/wrapper/layout/flex/flex.horizontal.js index 879383f83..fc9cad5d8 100644 --- a/src/core/wrapper/layout/flex/flex.horizontal.js +++ b/src/core/wrapper/layout/flex/flex.horizontal.js @@ -32,9 +32,13 @@ BI.FlexHorizontalLayout = BI.inherit(BI.Layout, { var o = this.options; var w = BI.FlexHorizontalLayout.superclass._addElement.apply(this, arguments); w.element.css({ - position: "relative", - "flex-shrink": "0" + position: "relative" }); + if (o.horizontalAlign === BI.HorizontalAlign.Left || o.horizontalAlign === BI.HorizontalAlign.Right) { + w.element.css({ + "flex-shrink": "0" + }); + } if (o.columnSize[i] > 0) { w.element.width(o.columnSize[i] <= 1 ? (o.columnSize[i] * 100 + "%") : o.columnSize[i]); } diff --git a/src/core/wrapper/layout/flex/flex.vertical.js b/src/core/wrapper/layout/flex/flex.vertical.js index 91b3f502e..9790bcd9b 100644 --- a/src/core/wrapper/layout/flex/flex.vertical.js +++ b/src/core/wrapper/layout/flex/flex.vertical.js @@ -31,9 +31,13 @@ BI.FlexVerticalLayout = BI.inherit(BI.Layout, { var w = BI.FlexVerticalLayout.superclass._addElement.apply(this, arguments); var o = this.options; w.element.css({ - position: "relative", - "flex-shrink": "0" + position: "relative" }); + if (o.verticalAlign === BI.VerticalAlign.Top || o.verticalAlign === BI.VerticalAlign.Bottom) { + w.element.css({ + "flex-shrink": "0" + }); + } if (o.rowSize[i] > 0) { w.element.height(o.rowSize[i] <= 1 ? (o.rowSize[i] * 100 + "%") : o.rowSize[i]); } diff --git a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js b/src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js index 31abd63ea..13e9e3088 100644 --- a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js +++ b/src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js @@ -33,9 +33,13 @@ BI.FlexWrapperHorizontalLayout = BI.inherit(BI.Layout, { var o = this.options; var w = BI.FlexWrapperHorizontalLayout.superclass._addElement.apply(this, arguments); w.element.css({ - position: "relative", - "flex-shrink": "0" + position: "relative" }); + if (o.horizontalAlign === BI.HorizontalAlign.Left || o.horizontalAlign === BI.HorizontalAlign.Right) { + w.element.css({ + "flex-shrink": "0" + }); + } if (o.columnSize[i] > 0) { w.element.width(o.columnSize[i] <= 1 ? (o.columnSize[i] * 100 + "%") : o.columnSize[i]); } diff --git a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.js b/src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.js index d83e8fb4e..ee463f8e4 100644 --- a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.js +++ b/src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.js @@ -33,9 +33,13 @@ BI.FlexWrapperVerticalLayout = BI.inherit(BI.Layout, { var o = this.options; var w = BI.FlexWrapperVerticalLayout.superclass._addElement.apply(this, arguments); w.element.css({ - position: "relative", - "flex-shrink": "0" + position: "relative" }); + if (o.verticalAlign === BI.VerticalAlign.Top || o.verticalAlign === BI.VerticalAlign.Bottom) { + w.element.css({ + "flex-shrink": "0" + }); + } if (o.rowSize[i] > 0) { w.element.height(o.rowSize[i] <= 1 ? (o.rowSize[i] * 100 + "%") : o.rowSize[i]); }