diff --git a/static/menu.js b/static/menu.js index 275e2921f..11540a243 100644 --- a/static/menu.js +++ b/static/menu.js @@ -49,6 +49,16 @@ backdrop.style.display = "block"; } function menuOnClick(e) { + // The "About", "Releases", and "Rust" menus act as menus on desktop, + // and links on mobile (due to pure-menu-opt-children). On desktop, + // we inhibit navigation events on click so the menu open action can + // take effect. Detect desktop by noticing that the second child + // is hidden. + console.log(this.children[1]); + console.log(window.getComputedStyle(this.children[1]).display); + if (this.children.length > 1 && window.getComputedStyle(this.children[1]).display != 'none') { + return false; + } if (this.getAttribute("href") != "#") { return; } diff --git a/templates/header/package_navigation.html b/templates/header/package_navigation.html index 38cd6802d..2d30e4e4f 100644 --- a/templates/header/package_navigation.html +++ b/templates/header/package_navigation.html @@ -43,7 +43,7 @@

{# If there are platforms, show a dropdown with them #} {%- if platforms -%}