Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Ivan Vargas <jvargas@gitlab.com>2017-05-09 18:09:20 +0300
committerJose Ivan Vargas <jvargas@gitlab.com>2017-05-22 20:55:01 +0300
commit42604d4c33e6098ba696d464c9a7b3d16656bf54 (patch)
tree49ce5e49ff2778ed6b996cdadf1f19d98b288782 /app/assets/javascripts/project_edit.js
parent18a6d9c5326bc2b90a1f0cc8664d638a39885924 (diff)
Prevent project transfer if a new group is not selected
Diffstat (limited to 'app/assets/javascripts/project_edit.js')
-rw-r--r--app/assets/javascripts/project_edit.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/app/assets/javascripts/project_edit.js b/app/assets/javascripts/project_edit.js
new file mode 100644
index 00000000000..042ec8e4494
--- /dev/null
+++ b/app/assets/javascripts/project_edit.js
@@ -0,0 +1,16 @@
+export default class ProjectEdit {
+ constructor() {
+ this.transferForm = $('.js-project-transfer-form');
+ this.selectNamespace = $('.js-project-transfer-form').find('.select2');
+
+ this.selectNamespaceChangedWrapper = this.selectNamespaceChanged.bind(this);
+ this.selectNamespace.on('change', this.selectNamespaceChangedWrapper);
+ this.selectNamespaceChanged();
+ }
+
+ selectNamespaceChanged() {
+ const selectedNamespaceValue = this.selectNamespace.val();
+
+ this.transferForm.find(':submit').prop('disabled', !selectedNamespaceValue);
+ }
+}