X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/1e7906c193d37eb40c734b93a8d152d87650562c..0eb72b526bf8bbb011551ecf019f604e17a534f1:/apps/workbench/app/views/application/report_issue_popup.js.erb 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 59aedbcf6e..bd11f9e1dc 100644 --- a/apps/workbench/app/views/application/report_issue_popup.js.erb +++ b/apps/workbench/app/views/application/report_issue_popup.js.erb @@ -1,7 +1,16 @@ +<%# Copyright (C) The Arvados Authors. All rights reserved. + +SPDX-License-Identifier: AGPL-3.0 %> + $("#report-issue-modal-window").html("<%= escape_javascript(render partial: 'report_issue_popup') %>"); +$("#report-issue-modal-window .modal").modal('show'); + +// Disable the submit button on modal loading +$submit = $('#report-issue-submit'); +$submit.prop('disabled', true); -// reset form input fields, for the next time around -function reset_form() { - $('#report_issue_text').val(""); - $('#additional_info').val(""); -} +// 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 === "")); +});