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 {
}
bindEvents() {
const dropdownButton = this.projectSelectInput.siblings('.new-project-item-select-button');
dropdownButton.on('click', this.openDropdown);
this.projectSelectInput.siblings('.new-project-item-select-button')
.on('click', e => this.openDropdown(e));
this.newItemBtn.on('click', (e) => {
if (!this.getProjectFromLocalStorage()) {
e.preventDefault();
dropdownButton.trigger('click');
this.openDropdown(e);
}
});
......@@ -36,8 +35,9 @@ export default class ProjectSelectComboButton {
}
}
openDropdown() {
$(this).siblings('.project-item-select').select2('open');
// eslint-disable-next-line class-methods-use-this
openDropdown(event) {
$(event.currentTarget).siblings('.project-item-select').select2('open');
}
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