mirror of https://github.com/zulip/zulip.git
Allow the user to dismiss send errors
(imported from commit bcce5f0a1cdc0d5eec2586e72f8a5945574697ad)
This commit is contained in:
parent
2313498891
commit
41adbfc92d
|
@ -46,6 +46,7 @@ $(function() {
|
|||
var status_classes = 'alert-error alert-success alert-info';
|
||||
var send_status = $('#send-status');
|
||||
var buttons = $('#class-message, #personal-message').find('input[type="submit"]');
|
||||
|
||||
var options = {
|
||||
beforeSubmit: function (form, _options) {
|
||||
send_status.removeClass(status_classes)
|
||||
|
@ -65,11 +66,16 @@ $(function() {
|
|||
error: function() {
|
||||
send_status.removeClass(status_classes)
|
||||
.addClass('alert-error')
|
||||
.text('Error sending message')
|
||||
.html('Error sending message ')
|
||||
.append($('<span />')
|
||||
.addClass('send-status-close').html('×')
|
||||
.click(function () { send_status.stop(true).fadeOut(500); }))
|
||||
.stop(true).fadeTo(0,1);
|
||||
|
||||
buttons.removeAttr('disabled');
|
||||
}
|
||||
};
|
||||
|
||||
send_status.hide();
|
||||
$("#class-message form").ajaxForm(options);
|
||||
$("#personal-message form").ajaxForm(options);
|
||||
|
|
|
@ -61,3 +61,22 @@ form.zephyr textarea {
|
|||
padding: 8px 14px 8px 14px;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
/* Like .alert .close */
|
||||
.send-status-close {
|
||||
font-size: 17px;
|
||||
font-weight: bold;
|
||||
color: black;
|
||||
text-shadow: 0 1px 0 white;
|
||||
opacity: .2;
|
||||
filter: alpha(opacity=20);
|
||||
margin-left: 5px;
|
||||
position: relative;
|
||||
top: 1px;
|
||||
}
|
||||
|
||||
.send-status-close:hover {
|
||||
cursor: pointer;
|
||||
opacity: .4;
|
||||
filter: alpha(opacity=40);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue