Allow the user to dismiss send errors

(imported from commit bcce5f0a1cdc0d5eec2586e72f8a5945574697ad)
This commit is contained in:
Keegan McAllister 2012-08-30 15:35:56 -04:00
parent 2313498891
commit 41adbfc92d
2 changed files with 26 additions and 1 deletions

View File

@ -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('&times;')
.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);

View File

@ -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);
}