diff --git a/static/script.js b/static/script.js index bcd8059..4950222 100644 --- a/static/script.js +++ b/static/script.js @@ -19,6 +19,10 @@ function hidetoggle(name) { } else { document.getElementById(name).style.display='inline-block'; } + hideOthers(name); +} + +function hideOthers(name) { var allElements = document.getElementsByTagName("*"); for (var i = 0, n = allElements.length; i < n; ++i) { var el = allElements[i]; @@ -30,6 +34,7 @@ function hidetoggle(name) { } function dropDown(name) { document.getElementById(name).classList.toggle("show"); + hideOthers('foo'); } // Close the dropdown menu if the user clicks outside of it diff --git a/templates/layout.html b/templates/layout.html index d37b940..1025731 100644 --- a/templates/layout.html +++ b/templates/layout.html @@ -20,17 +20,17 @@
⊆⊇
{% if shop %}