Merge branch 'master' into 3714-report-issue-issues
[arvados.git] / apps / workbench / app / views / application / report_issue_popup.js.erb
1 $("#report-issue-modal-window").html("<%= escape_javascript(render partial: 'report_issue_popup') %>");
2 $("#report-issue-modal-window .modal").modal('show');
3
4 // Disable the submit button until the problem description is entered
5 $submit = $('#report-issue-submit');
6
7 var problem_desc = document.forms["report-issue-form"]["report_issue_text"].value;
8 if (problem_desc == null || problem_desc == "") {
9   $submit.attr('disabled', true);
10 }
11
12 // capture events to enable submit button when applicable
13 $('#report_issue_text').bind('input propertychange', function() {
14   var problem_desc = document.forms["report-issue-form"]["report_issue_text"].value;
15
16   var trigger = false;
17   if (problem_desc == null || problem_desc == "") {
18     trigger = true;
19   }
20   trigger ? $submit.attr('disabled', true) : $submit.removeAttr('disabled');
21 });