From 8900a40f9d200f44bbefed56d08312e37f1e5483 Mon Sep 17 00:00:00 2001 From: zsmj Date: Tue, 28 Jun 2022 13:42:12 +0800 Subject: [PATCH] =?UTF-8?q?DESIGN-110=20feat:=20=E5=8F=8D=E9=A6=88-tooltip?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/single/tip/tip.tooltip.js | 41 +++++++++--------------------- 1 file changed, 12 insertions(+), 29 deletions(-) diff --git a/src/base/single/tip/tip.tooltip.js b/src/base/single/tip/tip.tooltip.js index 3276b96f6..dc147492b 100644 --- a/src/base/single/tip/tip.tooltip.js +++ b/src/base/single/tip/tip.tooltip.js @@ -7,8 +7,8 @@ */ BI.Tooltip = BI.inherit(BI.Tip, { _const: { - hgap: 5, - vgap: 3 + hgap: 8, + vgap: 4 }, _defaultConfig: function () { @@ -39,33 +39,16 @@ BI.Tooltip = BI.inherit(BI.Tip, { mousemove: fn }); - var texts = (o.text + "").split("\n"); - if (texts.length > 1) { - BI.createWidget({ - type: "bi.vertical", - element: this, - hgap: this._const.hgap, - items: BI.map(texts, function (i, text) { - return { - type: "bi.label", - textAlign: o.textAlign, - whiteSpace: "normal", - text: text, - textHeight: 18 - }; - }) - }); - } else { - this.text = BI.createWidget({ - type: "bi.label", - element: this, - textAlign: o.textAlign, - whiteSpace: "normal", - text: o.text, - textHeight: 18, - hgap: this._const.hgap - }); - } + this.text = BI.createWidget({ + type: "bi.label", + element: this, + textAlign: o.textAlign, + whiteSpace: "normal", + text: o.text, + textHeight: 20, + hgap: this._const.hgap, + vgap: this._const.vgap, + }); }, setWidth: function (width) {