diff options
Diffstat (limited to 'pydis_site/static/js/wiki/dropdown.js')
-rw-r--r-- | pydis_site/static/js/wiki/dropdown.js | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/pydis_site/static/js/wiki/dropdown.js b/pydis_site/static/js/wiki/dropdown.js deleted file mode 100644 index a914a4ab..00000000 --- a/pydis_site/static/js/wiki/dropdown.js +++ /dev/null @@ -1,35 +0,0 @@ -(function() { - window.dropdowns = {}; - - let elements = document.getElementsByClassName("dropdown"); - - for (let element of elements) { - let menu_element = element.getElementsByClassName("dropdown-menu")[0]; - - function show() { - $(element).addClass("is-active"); - } - - function hide() { - $(element).removeClass("is-active"); - } - - function handle_event(e) { - show(); - - $(document.body).on("click." + menu_element.id, function() { - hide(); - - $(document.body).off("click." + menu_element.id); - }); - - e.stopPropagation(); - } - - $(element).click(handle_event); - $(element).hover(handle_event); - $(element).mouseleave(hide); - - window.dropdowns[menu_element.id] = element; - } -})(); |