Browse Source

Pull request #2506: KERNEL-9882 toast视觉修改

Merge in VISUAL/fineui from ~WINDY/fui:master to master

* commit 'dda27d9470cc59ddec2b2b490692e56d00b3a796':
  KERNEL-9882 toast视觉修改
es6
windy 3 years ago
parent
commit
53a9a00409
  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, { BI.Toast = BI.inherit(BI.Tip, {
_const: { _const: {
minWidth: 200, closableMinWidth: 146,
hgap: 10 minWidth: 124,
closableMaxWidth: 410,
maxWidth: 400,
hgap: 8
}, },
_defaultConfig: function () { _defaultConfig: function () {
@ -22,9 +25,10 @@ BI.Toast = BI.inherit(BI.Tip, {
}, },
render: function () { render: function () {
var self = this, o = this.options; var self = this, o = this.options, c = this._const;
this.element.css({ 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); this.element.addClass("toast-" + o.level);
var fn = function (e) { var fn = function (e) {
@ -93,10 +97,9 @@ BI.Toast = BI.inherit(BI.Tip, {
this.text = BI.createWidget({ this.text = BI.createWidget({
type: "bi.horizontal", type: "bi.horizontal",
horizontalAlign: BI.HorizontalAlign.Stretch, horizontalAlign: BI.HorizontalAlign.Stretch,
verticalAlign: BI.VerticalAlign.Middle,
element: this, element: this,
items: items, items: items,
vgap: 7, vgap: 12,
columnSize: columnSize columnSize: columnSize
}); });
}, },

2
src/less/base/single/tip/tip.toast.less

@ -2,8 +2,6 @@
.bi-toast{ .bi-toast{
color: @color-bi-color-toast-text; color: @color-bi-color-toast-text;
max-width: 400px;
min-width: 150px;
line-height: @font-size-16; line-height: @font-size-16;
.border-radius(2px); .border-radius(2px);
&.toast-success{ &.toast-success{

Loading…
Cancel
Save