X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/3a43585742a41468abbd8a74511af6e2164bba1a..02717e4b0875ac5dd204bad1ca034e5814dc237d:/apps/workbench/app/assets/javascripts/report_issue.js diff --git a/apps/workbench/app/assets/javascripts/report_issue.js b/apps/workbench/app/assets/javascripts/report_issue.js index 15ff4bcb9c..539489d5fb 100644 --- a/apps/workbench/app/assets/javascripts/report_issue.js +++ b/apps/workbench/app/assets/javascripts/report_issue.js @@ -1,31 +1,31 @@ $(document). on('click', "#report-issue-submit", function(e){ $(this).html('Sending'); - $(this).attr('disabled', true); + $(this).prop('disabled', true); var $cancelButton = $('#report-issue-cancel'); if ($cancelButton) { $cancelButton.html('Close'); } $('div').remove('.modal-footer-status'); - $.ajax('/'). - success(function(data, status, jqxhr) { + $.ajax('/report_issue', { + type: 'POST', + data: $(this).parents('form').serialize() + }).success(function(data, status, jqxhr) { var $sendButton = $('#report-issue-submit'); $sendButton.html('Report sent'); $('div').remove('.modal-footer-status'); - $('.modal-footer').append('

'); - }). - fail(function(jqxhr, status, error) { + $('.modal-footer').append('

'); + }).fail(function(jqxhr, status, error) { var $sendButton = $('#report-issue-submit'); if ($sendButton && $sendButton.prop('disabled')) { - $('div').remove('.modal-footer-status'); - $('.modal-footer').append('

'); - $sendButton.html('Send problem report'); - $sendButton.attr('disabled',false); - } + $('div').remove('.modal-footer-status'); + $('.modal-footer').append('

'); + $sendButton.html('Send problem report'); + $sendButton.prop('disabled', false); + } var $cancelButton = $('#report-issue-cancel'); - var text = document.getElementById('report-issue-cancel').firstChild; $cancelButton.html('Cancel'); - }); - + }); + return false; });