From ca09f7c835a1d1f9602e4e03b8e756d641d05032 Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 28 Aug 2020 12:57:41 +0800 Subject: [PATCH] bugfix --- src/core/platform/web/config.js | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/core/platform/web/config.js b/src/core/platform/web/config.js index b2d882b152..397f3ac217 100644 --- a/src/core/platform/web/config.js +++ b/src/core/platform/web/config.js @@ -36,12 +36,10 @@ BI.prepares.push(function () { BI.Plugin.configWidget("bi.center_adapt", function (ob) { var isIE = BI.isIE(), supportFlex = isSupportFlex(), justOneItem = (ob.items && ob.items.length <= 1); var isAdapt = !ob.horizontalAlign || ob.horizontalAlign === BI.HorizontalAlign.Center || ob.horizontalAlign === BI.HorizontalAlign.Stretch; - if (!isIE && supportFlex) { - if (!isAdapt || justOneItem) { + if (!isAdapt || justOneItem) { + if (!isIE && supportFlex) { return BI.extend(ob, {type: "bi.flex_center_adapt"}); } - } - if (!isAdapt || justOneItem) { return BI.extend(ob, {type: "bi.inline_center_adapt"}); } return ob; @@ -49,19 +47,18 @@ BI.prepares.push(function () { BI.Plugin.configWidget("bi.vertical_adapt", function (ob) { var isIE = BI.isIE(), supportFlex = isSupportFlex(), justOneItem = (ob.items && ob.items.length <= 1); var isAdapt = ob.horizontalAlign === BI.HorizontalAlign.Center || ob.horizontalAlign === BI.HorizontalAlign.Stretch; - if (!isIE && supportFlex) { - if (!isAdapt || justOneItem) { + if (!isAdapt || justOneItem) { + if (!isIE && supportFlex) { return BI.extend(ob, {type: "bi.flex_vertical_center_adapt"}); } - } - if (!isAdapt || justOneItem) { return BI.extend(ob, {type: "bi.inline_vertical_adapt"}); } return ob; }); BI.Plugin.configWidget("bi.horizontal_adapt", function (ob) { + var justOneItem = (ob.items && ob.items.length <= 1); if (!ob.verticalAlign || ob.verticalAlign === BI.VerticalAlign.TOP) { - if (ob.items && ob.items.length <= 1) { + if (justOneItem) { return BI.extend(ob, {type: "bi.horizontal_auto"}); } }