提交 18dfa979 编写于 作者: C Catouse

* improve UI of messager.

上级 a949c952
......@@ -163,6 +163,10 @@
$icon.remove();
}
that.$.toggleClass('messager-has-icon', !!icon);
if (!that.updateTime) {
options.onUpdate && options.onUpdate.call(that, options);
}
that.updateTime = Date.now();
};
Messager.prototype.show = function(message, callback) {
......@@ -213,6 +217,7 @@
that.isShow = true;
callback && callback();
options.onShow && options.onShow.call(that, options);
return that;
};
......@@ -222,6 +227,7 @@
callback = null;
}
var that = this;
var options = that.options;
if(that.$.hasClass('in')) {
that.$.removeClass('in');
var removeMessager = function() {
......@@ -229,11 +235,13 @@
that.$.detach();
if(!$parent.children().length) $parent.remove();
callback && callback(true);
options.onHide && options.onHide.call(that, immediately);
};
if(immediately) removeMessager();
else setTimeout(removeMessager, 200);
} else {
callback && callback(false);
options.onHide && options.onHide.call(that, immediately);
}
that.isShow = false;
......@@ -257,7 +265,7 @@
});
} else {
var msg = $('#messager-' + id).data('zui.messager');
if(msg && msg.hide) msg.hide(true);
if(msg && msg.hide) msg.hide();
}
};
......
......@@ -737,7 +737,7 @@
@messager-radius: 20px;
@messager-notification-radius: @border-radius-base;
@messager-notification-min-width: 300px;
@messager-notification-min-width: 250px;
@messager-notification-max-width: 400px;
......
......@@ -32,6 +32,9 @@
padding: 10px 15px;
display: table-cell;
vertical-align: top;
a {
color: inherit; font-weight: bold;
}
}
.messager-title {
......@@ -39,7 +42,7 @@
font-size: @font-size-large;
+ .messager-text {
margin-top: 5px;
margin-top: 10px;
}
}
......@@ -141,12 +144,16 @@
}
}
.messager-text {
> p:last-child {margin: 0;}
}
.messager-primary {
background-color: @state-primary-inverse-bg;
}
.messager-success {
background-color: @state-success-inverse-bg;
background-color: @state-success-inverse-bg;
}
.messager-info {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册