5614: Workbench renders error flash separately from others.
[arvados.git] / apps / workbench / app / views / application / report_issue_popup.js.erb
index 5cfe502166f86210a107314786913c8b2188777e..73830ee0494b6e6039cdf3fb2a3c2c52c717f415 100644 (file)
@@ -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 === ""));
+});