From: Dan Brown Date: Mon, 6 May 2019 16:59:17 +0000 (+0100) Subject: Updated dropdowns to close all others before opening X-Git-Tag: v0.26.0~1^2~1 X-Git-Url: http://source.bookstackapp.com/bookstack/commitdiff_plain/6797c91eebeaeb3d9ff456d87c024448f3cbabf6?ds=inline Updated dropdowns to close all others before opening --- diff --git a/resources/assets/js/components/dropdown.js b/resources/assets/js/components/dropdown.js index ce797bbeb..3887e8432 100644 --- a/resources/assets/js/components/dropdown.js +++ b/resources/assets/js/components/dropdown.js @@ -14,7 +14,7 @@ class DropDown { } show(event) { - this.hide(); + this.hideAll(); this.menu.style.display = 'block'; this.menu.classList.add('anim', 'menuIn'); @@ -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');