From 38a8b9c46be0155c4302da9fa58ca130777f28ab Mon Sep 17 00:00:00 2001 From: dailer Date: Wed, 29 May 2019 11:17:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1,=20=20label=20?= =?UTF-8?q?=5FcreateNotCenterEl=E7=9A=84=E6=97=B6=E5=80=99=E8=A6=81?= =?UTF-8?q?=E6=A0=B9=E6=8D=AEtextAlign=E6=9D=A5=E5=86=B3=E5=AE=9A=E7=94=A8?= =?UTF-8?q?vertical=5Fadapt=E8=BF=98=E6=98=AFright=5Fvertical=5Fadapt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/single/label/html.label.js | 11 ++++++----- src/base/single/label/label.js | 11 ++++++----- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/base/single/label/html.label.js b/src/base/single/label/html.label.js index d94e4002d..bd3e41701 100644 --- a/src/base/single/label/html.label.js +++ b/src/base/single/label/html.label.js @@ -194,13 +194,14 @@ BI.HtmlLabel = BI.inherit(BI.Single, { _createNotCenterEl: function () { var o = this.options; + var adaptLayout = o.textAlign === "right" ? "bi.right_vertical_adapt" : "bi.vertical_adapt"; var json = this._createJson(); if (BI.isNumber(o.width) && o.width > 0) { if (BI.isNumber(o.textWidth) && o.textWidth > 0) { json.width = o.textWidth; if (BI.isNumber(o.height) && o.height > 0) { BI.createWidget({ - type: "bi.vertical_adapt", + type: adaptLayout, height: o.height, scrollable: o.whiteSpace === "normal", element: this, @@ -213,7 +214,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, { return; } BI.createWidget({ - type: "bi.vertical_adapt", + type: adaptLayout, scrollable: o.whiteSpace === "normal", hgap: o.hgap, vgap: o.vgap, @@ -249,7 +250,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, { } json.width = o.width - 2 * o.hgap - o.lgap - o.rgap; BI.createWidget({ - type: "bi.vertical_adapt", + type: adaptLayout, scrollable: o.whiteSpace === "normal", hgap: o.hgap, vgap: o.vgap, @@ -267,7 +268,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, { if (BI.isNumber(o.textWidth) && o.textWidth > 0) { json.width = o.textWidth; BI.createWidget({ - type: "bi.vertical_adapt", + type: adaptLayout, scrollable: o.whiteSpace === "normal", hgap: o.hgap, vgap: o.vgap, @@ -314,7 +315,7 @@ BI.HtmlLabel = BI.inherit(BI.Single, { maxWidth: "100%" })); BI.createWidget({ - type: "bi.vertical_adapt", + type: adaptLayout, element: this, items: [this.text] }); diff --git a/src/base/single/label/label.js b/src/base/single/label/label.js index 68709dbab..de93b483d 100644 --- a/src/base/single/label/label.js +++ b/src/base/single/label/label.js @@ -203,13 +203,14 @@ BI.Label = BI.inherit(BI.Single, { _createNotCenterEl: function () { var o = this.options; + var adaptLayout = o.textAlign === "right" ? "bi.right_vertical_adapt" : "bi.vertical_adapt"; var json = this._createJson(); if (BI.isNumber(o.width) && o.width > 0) { if (BI.isNumber(o.textWidth) && o.textWidth > 0) { json.width = o.textWidth; if (BI.isNumber(o.height) && o.height > 0) { // 2.1 BI.createWidget({ - type: "bi.vertical_adapt", + type: adaptLayout, height: o.height, scrollable: o.whiteSpace === "normal", element: this, @@ -222,7 +223,7 @@ BI.Label = BI.inherit(BI.Single, { return; } BI.createWidget({ // 2.2 - type: "bi.vertical_adapt", + type: adaptLayout, scrollable: o.whiteSpace === "normal", hgap: o.hgap, vgap: o.vgap, @@ -258,7 +259,7 @@ BI.Label = BI.inherit(BI.Single, { } json.width = o.width - 2 * o.hgap - o.lgap - o.rgap; BI.createWidget({ // 2.4 - type: "bi.vertical_adapt", + type: adaptLayout, scrollable: o.whiteSpace === "normal", hgap: o.hgap, vgap: o.vgap, @@ -276,7 +277,7 @@ BI.Label = BI.inherit(BI.Single, { if (BI.isNumber(o.textWidth) && o.textWidth > 0) { json.width = o.textWidth; BI.createWidget({ // 2.5 - type: "bi.vertical_adapt", + type: adaptLayout, scrollable: o.whiteSpace === "normal", hgap: o.hgap, vgap: o.vgap, @@ -323,7 +324,7 @@ BI.Label = BI.inherit(BI.Single, { maxWidth: "100%" })); BI.createWidget({ - type: "bi.vertical_adapt", + type: adaptLayout, element: this, items: [this.text] });