Added create#ensure_unique_name to discovery document. "Add a subproject"
[arvados.git] / apps / workbench / app / views / application / report_issue_popup.js.erb
index 59aedbcf6e585484983715753f55596f97df08e4..6795c091fc332a3007e0c575e2f6fc42d2916aa2 100644 (file)
@@ -1,7 +1,16 @@
 $("#report-issue-modal-window").html("<%= escape_javascript(render partial: 'report_issue_popup') %>");
+$("#report-issue-modal-window .modal").modal('show');
 
-// reset form input fields, for the next time around
-function reset_form() {
-  $('#report_issue_text').val("");
-  $('#additional_info').val("");
-}
+// Disable the submit button on modal loading
+$submit = $('#report-issue-submit');
+$submit.attr('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;
+  if (problem_desc === null || problem_desc === "") {
+    $submit.attr('disabled', true)
+  } else {
+    $submit.removeAttr('disabled');
+  }
+});