From: Tom Hughes Date: Thu, 12 Apr 2012 14:41:11 +0000 (+0100) Subject: Stop the menu appearing when the anchor is disabled X-Git-Tag: live~5595 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/cca526d93901b42c91d9718a3dc89beade1b69b5?hp=e2cb47f1ae6c1053ba772ca488a32fab114f2cfd Stop the menu appearing when the anchor is disabled --- diff --git a/app/assets/javascripts/menu.js b/app/assets/javascripts/menu.js index 595b15398..a01fc39cc 100644 --- a/app/assets/javascripts/menu.js +++ b/app/assets/javascripts/menu.js @@ -34,14 +34,16 @@ function createMenu(anchorid, menuid, align) { } $arrow.click(function(e) { - e.stopPropagation(); - e.preventDefault(); - if ($menu.is(":visible")) { - $menu.hide(); - $page.off("click", hide); - } else { - openMenu($anchor, $menu.show(), align); - $page.on("click", hide); + if ($anchor.is(":not(.disabled)")) { + e.stopPropagation(); + e.preventDefault(); + if ($menu.is(":visible")) { + $menu.hide(); + $page.off("click", hide); + } else { + openMenu($anchor, $menu.show(), align); + $page.on("click", hide); + } } }); }