diff options
Diffstat (limited to 'assets/js/src/Project.js')
-rw-r--r-- | assets/js/src/Project.js | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/assets/js/src/Project.js b/assets/js/src/Project.js new file mode 100644 index 00000000..19941f03 --- /dev/null +++ b/assets/js/src/Project.js @@ -0,0 +1,28 @@ +function Project() { +} + +Project.prototype.listen = function() { + $('.project-change-role').on('change', function() { + $.ajax({ + cache: false, + url: $(this).data('url'), + contentType: "application/json", + type: "POST", + processData: false, + data: JSON.stringify({ + "id": $(this).data('id'), + "role": $(this).val() + }) + }); + }); + + $('#project-creation-form #form-src_project_id').on('change', function() { + var srcProjectId = $(this).val(); + + if (srcProjectId == 0) { + $(".project-creation-options").hide(); + } else { + $(".project-creation-options").show(); + } + }); +}; |