summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2017-08-31 10:48:16 +0000
committerJose Ivan Vargas <jvargas@gitlab.com>2017-09-01 17:32:18 -0500
commit0b50c9226c0ce152be90d269db867bd3c750dfe5 (patch)
treef56a3b9d1457d9c035efdf99f022fa0e202d66a0 /app
parent89e2feab0a6f33b0da7b0d868a22082c7643bc3e (diff)
downloadgitlab-ce-0b50c9226c0ce152be90d269db867bd3c750dfe5.tar.gz
Revert "Merge branch '37179-dashboard-project-dropdown' into 'master'"
This reverts commit 6d6223ecdb3b87a061aecf7b2c586cadc0f29695, reversing changes made to cc7811707424ebd58b71428c9fe27c444dd6169d.
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/project_select_combo_button.js16
1 files changed, 5 insertions, 11 deletions
diff --git a/app/assets/javascripts/project_select_combo_button.js b/app/assets/javascripts/project_select_combo_button.js
index 6820148ad19..822ca41a574 100644
--- a/app/assets/javascripts/project_select_combo_button.js
+++ b/app/assets/javascripts/project_select_combo_button.js
@@ -14,14 +14,7 @@ export default class ProjectSelectComboButton {
bindEvents() {
this.projectSelectInput.siblings('.new-project-item-select-button')
- .on('click', e => this.openDropdown(e));
-
- this.newItemBtn.on('click', (e) => {
- if (!this.getProjectFromLocalStorage()) {
- e.preventDefault();
- this.openDropdown(e);
- }
- });
+ .on('click', this.openDropdown);
this.projectSelectInput.on('change', () => this.selectProject());
}
@@ -37,9 +30,8 @@ export default class ProjectSelectComboButton {
}
}
- // eslint-disable-next-line class-methods-use-this
- openDropdown(event) {
- $(event.currentTarget).siblings('.project-item-select').select2('open');
+ openDropdown() {
+ $(this).siblings('.project-item-select').select2('open');
}
selectProject() {
@@ -66,8 +58,10 @@ export default class ProjectSelectComboButton {
if (project) {
this.newItemBtn.attr('href', project.url);
this.newItemBtn.text(`${this.formattedText.defaultTextPrefix} in ${project.name}`);
+ this.newItemBtn.enable();
} else {
this.newItemBtn.text(`Select project to create ${this.formattedText.presetTextSuffix}`);
+ this.newItemBtn.disable();
}
}