From 43bfb7e13e43ed2971ada2f3df285a871868b048 Mon Sep 17 00:00:00 2001 From: guy Date: Thu, 18 Feb 2021 16:38:15 +0800 Subject: [PATCH] update --- src/base/single/label/abstract.label.js | 24 +++++++++---------- .../wrapper/layout/flex/flex.horizontal.js | 2 +- src/core/wrapper/layout/flex/flex.vertical.js | 2 +- .../flex/wrapper/flex.wrapper.horizontal.js | 2 +- .../flex/wrapper/flex.wrapper.vertical.js | 2 +- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/base/single/label/abstract.label.js b/src/base/single/label/abstract.label.js index c6ed27bec..c3b8c378d 100644 --- a/src/base/single/label/abstract.label.js +++ b/src/base/single/label/abstract.label.js @@ -59,7 +59,7 @@ BI.createWidget({ type: "bi.center_adapt", height: o.height, - columnSize: [""], // important让文字shrink为1 + columnSize: [o.whiteSpace === "normal" ? "auto" : ""], // important让文字shrink为1 scrollable: o.whiteSpace === "normal", element: this, items: [ @@ -72,7 +72,7 @@ } BI.createWidget({ // 1.2 type: "bi.center_adapt", - columnSize: [""], // important让文字shrink为1 + columnSize: [o.whiteSpace === "normal" ? "auto" : ""], // important让文字shrink为1 scrollable: o.whiteSpace === "normal", element: this, items: [ @@ -95,7 +95,7 @@ this.text = BI.createWidget(json); BI.createWidget({ type: "bi.center_adapt", - columnSize: [""], // important让文字shrink为1 + columnSize: [o.whiteSpace === "normal" ? "auto" : ""], // important让文字shrink为1 scrollable: o.whiteSpace === "normal", element: this, items: [this.text] @@ -130,7 +130,7 @@ this.text = BI.createWidget(json); BI.createWidget({ type: "bi.center_adapt", - columnSize: [""], // important让文字shrink为1 + columnSize: [o.whiteSpace === "normal" ? "auto" : ""], // important让文字shrink为1 scrollable: o.whiteSpace === "normal", element: this, items: [this.text] @@ -141,7 +141,7 @@ json.maxWidth = o.textWidth; BI.createWidget({ type: "bi.center_adapt", - columnSize: [""], // important让文字shrink为1 + columnSize: [o.whiteSpace === "normal" ? "auto" : ""], // important让文字shrink为1 scrollable: o.whiteSpace === "normal", element: this, items: [ @@ -164,7 +164,7 @@ this.text = BI.createWidget(json); BI.createWidget({ type: "bi.center_adapt", - columnSize: [""], // important让文字shrink为1 + columnSize: [o.whiteSpace === "normal" ? "auto" : ""], // important让文字shrink为1 scrollable: true, element: this, items: [this.text] @@ -201,7 +201,7 @@ })); BI.createWidget({ type: "bi.center_adapt", - columnSize: [""], // important让文字shrink为1 + columnSize: [o.whiteSpace === "normal" ? "auto" : ""], // important让文字shrink为1 element: this, items: [this.text] }); @@ -218,7 +218,7 @@ BI.createWidget({ type: adaptLayout, horizontalAlign: o.textAlign, - columnSize: [""], // important让文字shrink为1 + columnSize: [o.whiteSpace === "normal" ? "auto" : ""], // important让文字shrink为1 height: o.height, scrollable: o.whiteSpace === "normal", element: this, @@ -233,7 +233,7 @@ BI.createWidget({ // 2.2 type: adaptLayout, horizontalAlign: o.textAlign, - columnSize: [""], // important让文字shrink为1 + columnSize: [o.whiteSpace === "normal" ? "auto" : ""], // important让文字shrink为1 scrollable: o.whiteSpace === "normal", hgap: o.hgap, vgap: o.vgap, @@ -271,7 +271,7 @@ BI.createWidget({ // 2.4 type: adaptLayout, horizontalAlign: o.textAlign, - columnSize: [""], // important让文字shrink为1 + columnSize: [o.whiteSpace === "normal" ? "auto" : ""], // important让文字shrink为1 scrollable: o.whiteSpace === "normal", hgap: o.hgap, vgap: o.vgap, @@ -291,7 +291,7 @@ BI.createWidget({ // 2.5 type: adaptLayout, horizontalAlign: o.textAlign, - columnSize: [""], // important让文字shrink为1 + columnSize: [o.whiteSpace === "normal" ? "auto" : ""], // important让文字shrink为1 scrollable: o.whiteSpace === "normal", hgap: o.hgap, vgap: o.vgap, @@ -340,7 +340,7 @@ BI.createWidget({ type: adaptLayout, horizontalAlign: o.textAlign, - columnSize: [""], // important让文字shrink为1 + columnSize: [o.whiteSpace === "normal" ? "auto" : ""], // important让文字shrink为1 element: this, scrollable: o.whiteSpace === "normal", items: [this.text] diff --git a/src/core/wrapper/layout/flex/flex.horizontal.js b/src/core/wrapper/layout/flex/flex.horizontal.js index a4957003b..22cd106af 100644 --- a/src/core/wrapper/layout/flex/flex.horizontal.js +++ b/src/core/wrapper/layout/flex/flex.horizontal.js @@ -34,7 +34,7 @@ BI.FlexHorizontalLayout = BI.inherit(BI.Layout, { w.element.css({ position: "relative" }); - if (o.horizontalAlign !== BI.HorizontalAlign.Stretch && o.columnSize[i] !== "") { + if (o.horizontalAlign !== BI.HorizontalAlign.Stretch && o.columnSize[i] !== "auto") { w.element.css({ "flex-shrink": "0" }); diff --git a/src/core/wrapper/layout/flex/flex.vertical.js b/src/core/wrapper/layout/flex/flex.vertical.js index 0b5fa88ec..8de8e6d31 100644 --- a/src/core/wrapper/layout/flex/flex.vertical.js +++ b/src/core/wrapper/layout/flex/flex.vertical.js @@ -33,7 +33,7 @@ BI.FlexVerticalLayout = BI.inherit(BI.Layout, { w.element.css({ position: "relative" }); - if (o.verticalAlign !== BI.VerticalAlign.Stretch && o.rowSize[i] !== "") { + if (o.verticalAlign !== BI.VerticalAlign.Stretch && o.rowSize[i] !== "auto") { w.element.css({ "flex-shrink": "0" }); 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 ec7680f38..ce695e8c3 100644 --- a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js +++ b/src/core/wrapper/layout/flex/wrapper/flex.wrapper.horizontal.js @@ -35,7 +35,7 @@ BI.FlexWrapperHorizontalLayout = BI.inherit(BI.Layout, { w.element.css({ position: "relative" }); - if (o.horizontalAlign !== BI.HorizontalAlign.Stretch && o.columnSize[i] !== "") { + if (o.horizontalAlign !== BI.HorizontalAlign.Stretch && o.columnSize[i] !== "auto") { w.element.css({ "flex-shrink": "0" }); 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 d979a5421..0c373fa19 100644 --- a/src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.js +++ b/src/core/wrapper/layout/flex/wrapper/flex.wrapper.vertical.js @@ -35,7 +35,7 @@ BI.FlexWrapperVerticalLayout = BI.inherit(BI.Layout, { w.element.css({ position: "relative" }); - if (o.verticalAlign !== BI.VerticalAlign.Stretch && o.rowSize[i] !== "") { + if (o.verticalAlign !== BI.VerticalAlign.Stretch && o.rowSize[i] !== "auto") { w.element.css({ "flex-shrink": "0" });