X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/a942e37250873d383bd885ba0dba70c63b3c073d..0561bd0c3c07257fd58ded6c7cfa5feeae97af57:/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 e769d80957..0285693e88 100644 --- a/apps/workbench/app/assets/javascripts/report_issue.js +++ b/apps/workbench/app/assets/javascripts/report_issue.js @@ -1,30 +1,35 @@ +// Copyright (C) The Arvados Authors. All rights reserved. +// +// SPDX-License-Identifier: AGPL-3.0 + $(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) { + }).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); + $sendButton.prop('disabled', false); } var $cancelButton = $('#report-issue-cancel'); $cancelButton.html('Cancel'); - }); - + }); + return false; });