X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/c6378b0e7da030652334366c8459ff3853811529..5536864737f7729775f9b2ee95516d6df5053451:/apps/workbench/app/views/application/report_issue_popup.js.erb?ds=sidebyside diff --git a/apps/workbench/app/views/application/report_issue_popup.js.erb b/apps/workbench/app/views/application/report_issue_popup.js.erb index 5cfe502166..73830ee049 100644 --- a/apps/workbench/app/views/application/report_issue_popup.js.erb +++ b/apps/workbench/app/views/application/report_issue_popup.js.erb @@ -1,6 +1,12 @@ $("#report-issue-modal-window").html("<%= escape_javascript(render partial: 'report_issue_popup') %>"); $("#report-issue-modal-window .modal").modal('show'); -$('#report-issue-modal-window').on('hidden.bs.modal', function () { - location.reload(); -}) +// Disable the submit button on modal loading +$submit = $('#report-issue-submit'); +$submit.prop('disabled', true); + +// capture events to enable submit button when applicable +$('#report_issue_text').bind('input propertychange', function() { + var problem_desc = document.forms["report-issue-form"]["report_issue_text"].value; + $submit.prop('disabled', (problem_desc === null) || (problem_desc === "")); +});