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