Commit 7a0a9c23 authored by Filipa Lacerda's avatar Filipa Lacerda

Use the correct scope to avoid triggering all dropdowns

parent 0232cabc
...@@ -13,14 +13,13 @@ export default class ProjectSelectComboButton { ...@@ -13,14 +13,13 @@ export default class ProjectSelectComboButton {
} }
bindEvents() { bindEvents() {
const dropdownButton = this.projectSelectInput.siblings('.new-project-item-select-button'); this.projectSelectInput.siblings('.new-project-item-select-button')
.on('click', e => this.openDropdown(e));
dropdownButton.on('click', this.openDropdown);
this.newItemBtn.on('click', (e) => { this.newItemBtn.on('click', (e) => {
if (!this.getProjectFromLocalStorage()) { if (!this.getProjectFromLocalStorage()) {
e.preventDefault(); e.preventDefault();
dropdownButton.trigger('click'); this.openDropdown(e);
} }
}); });
...@@ -36,8 +35,9 @@ export default class ProjectSelectComboButton { ...@@ -36,8 +35,9 @@ export default class ProjectSelectComboButton {
} }
} }
openDropdown() { // eslint-disable-next-line class-methods-use-this
$(this).siblings('.project-item-select').select2('open'); openDropdown(event) {
$(event.currentTarget).siblings('.project-item-select').select2('open');
} }
selectProject() { selectProject() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment