2 on('click', "#report-issue-submit", function(e){
3 $(this).html('Sending');
4 $(this).prop('disabled', true);
5 var $cancelButton = $('#report-issue-cancel');
7 $cancelButton.html('Close');
9 $('div').remove('.modal-footer-status');
12 success(function(data, status, jqxhr) {
13 var $sendButton = $('#report-issue-submit');
14 $sendButton.html('Report sent');
15 $('div').remove('.modal-footer-status');
16 $('.modal-footer').append('<div><br/></div><div class="modal-footer-status alert alert-success"><p class="contain-align-left">Thanks for reporting this issue!</p></div>');
18 fail(function(jqxhr, status, error) {
19 var $sendButton = $('#report-issue-submit');
20 if ($sendButton && $sendButton.prop('disabled')) {
21 $('div').remove('.modal-footer-status');
22 $('.modal-footer').append('<div><br/></div><div class="modal-footer-status alert alert-danger"><p class="contain-align-left">We are sorry. We could not submit your report! We really want this to work, though -- please try again.</p></div>');
23 $sendButton.html('Send problem report');
24 $sendButton.prop('disabled', false);
26 var $cancelButton = $('#report-issue-cancel');
27 $cancelButton.html('Cancel');