diff --git a/src/base/single/tip/tip.toast.js b/src/base/single/tip/tip.toast.js index a9a7aeb7e..0440ee23d 100644 --- a/src/base/single/tip/tip.toast.js +++ b/src/base/single/tip/tip.toast.js @@ -11,7 +11,6 @@ BI.Toast = BI.inherit(BI.Tip, { minWidth: 100, closableMaxWidth: 410, maxWidth: 400, - hgap: 8 }, _defaultConfig: function () { @@ -21,7 +20,10 @@ BI.Toast = BI.inherit(BI.Tip, { level: "success", // success或warning autoClose: true, closable: null, - vgap: 7, + textHeight: 20, + vgap: 10, + innerHgap: 4, + hgap: 8, }); }, @@ -46,7 +48,7 @@ BI.Toast = BI.inherit(BI.Tip, { mouseleave: fn, mousemove: fn }); - var cls = "close-font"; + var cls; switch (o.level) { case "success": cls = "toast-success-font"; @@ -72,19 +74,18 @@ BI.Toast = BI.inherit(BI.Tip, { var items = [{ type: "bi.icon_label", cls: cls + " toast-icon", - width: 36 + height: o.textHeight, }, { el: BI.isPlainObject(o.text) ? o.text : { type: "bi.label", whiteSpace: "normal", text: o.text, - textHeight: 16, + textHeight: o.textHeight, textAlign: "left" }, - rgap: hasCloseIcon() ? 0 : this._const.hgap }]; - var columnSize = [36, "fill"]; + var columnSize = ["", "fill"]; if (hasCloseIcon()) { items.push({ @@ -93,23 +94,20 @@ BI.Toast = BI.inherit(BI.Tip, { handler: function () { self.destroy(); }, - width: 36 + height: o.textHeight, }); - columnSize.push(36); + columnSize.push(""); } - this.text = BI.createWidget({ + return { type: "bi.horizontal", horizontalAlign: BI.HorizontalAlign.Stretch, - element: this, items: items, + hgap: o.hgap, vgap: o.vgap, + innerHgap: o.innerHgap, columnSize: columnSize - }); - }, - - setText: function (text) { - this.text.setText(text); + }; }, beforeDestroy: function () {