]> BookStack Code Mirror - bookstack/commitdiff
Updated dropdowns to close all others before opening
authorDan Brown <redacted>
Mon, 6 May 2019 16:59:17 +0000 (17:59 +0100)
committerDan Brown <redacted>
Mon, 6 May 2019 16:59:17 +0000 (17:59 +0100)
resources/assets/js/components/dropdown.js

index ce797bbeb31976c351335888c92b80b30c8d2fdb..3887e8432289d23e2f81cd01424c7476428c8e33 100644 (file)
@@ -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');
Morty Proxy This is a proxified and sanitized view of the page, visit original site.