Browse Source

KERNEL-9882 toast视觉修改

es6
windy 3 years ago
parent
commit
dda27d9470
  1. 15
      src/base/single/tip/tip.toast.js
  2. 2
      src/less/base/single/tip/tip.toast.less

15
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
});
},

2
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{

Loading…
Cancel
Save