Skip to content

Commit

Permalink
Updated dropdowns to close all others before opening
Browse files Browse the repository at this point in the history
  • Loading branch information
ssddanbrown committed May 6, 2019
1 parent b9ad3f9 commit 6797c91
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion resources/assets/js/components/dropdown.js
Expand Up @@ -14,7 +14,7 @@ class DropDown {
}

show(event) {
this.hide();
this.hideAll();

this.menu.style.display = 'block';
this.menu.classList.add('anim', 'menuIn');
Expand Down Expand Up @@ -44,6 +44,12 @@ class DropDown {
event.stopPropagation();
}

hideAll() {
for (let dropdown of window.components.dropdown) {
dropdown.hide();
}
}

hide() {
this.menu.style.display = 'none';
this.menu.classList.remove('anim', 'menuIn');
Expand Down

0 comments on commit 6797c91

Please sign in to comment.