From dda27d9470cc59ddec2b2b490692e56d00b3a796 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Fri, 25 Feb 2022 10:31:37 +0800 Subject: [PATCH] =?UTF-8?q?KERNEL-9882=20toast=E8=A7=86=E8=A7=89=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/single/tip/tip.toast.js | 15 +++++++++------ src/less/base/single/tip/tip.toast.less | 2 -- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/base/single/tip/tip.toast.js b/src/base/single/tip/tip.toast.js index cf2a61476..ffbf2b336 100644 --- a/src/base/single/tip/tip.toast.js +++ b/src/base/single/tip/tip.toast.js @@ -7,8 +7,11 @@ */ BI.Toast = BI.inherit(BI.Tip, { _const: { - minWidth: 200, - hgap: 10 + closableMinWidth: 146, + minWidth: 124, + closableMaxWidth: 410, + maxWidth: 400, + hgap: 8 }, _defaultConfig: function () { @@ -22,9 +25,10 @@ BI.Toast = BI.inherit(BI.Tip, { }, render: function () { - var self = this, o = this.options; + var self = this, o = this.options, c = this._const; this.element.css({ - minWidth: this._const.minWidth / BI.pixRatio + BI.pixUnit + minWidth: (o.closable ? c.closableMinWidth : c.minWidth) / BI.pixRatio + BI.pixUnit, + maxWidth: (o.closable ? c.closableMaxWidth : c.maxWidth) / BI.pixRatio + BI.pixUnit }); this.element.addClass("toast-" + o.level); var fn = function (e) { @@ -93,10 +97,9 @@ BI.Toast = BI.inherit(BI.Tip, { this.text = BI.createWidget({ type: "bi.horizontal", horizontalAlign: BI.HorizontalAlign.Stretch, - verticalAlign: BI.VerticalAlign.Middle, element: this, items: items, - vgap: 7, + vgap: 12, columnSize: columnSize }); }, diff --git a/src/less/base/single/tip/tip.toast.less b/src/less/base/single/tip/tip.toast.less index 7f7838f29..49b174614 100644 --- a/src/less/base/single/tip/tip.toast.less +++ b/src/less/base/single/tip/tip.toast.less @@ -2,8 +2,6 @@ .bi-toast{ color: @color-bi-color-toast-text; - max-width: 400px; - min-width: 150px; line-height: @font-size-16; .border-radius(2px); &.toast-success{