From: Tom Hughes Date: Wed, 17 Nov 2010 15:52:08 +0000 (+0000) Subject: Don't display the menu when the anchor is disabled X-Git-Tag: live~6244^2~30 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/46af060a3708c2d213e550a2d7482cdf56a92e9c?hp=918dd5679f893313688dc2033fb8f46bf8463c0e Don't display the menu when the anchor is disabled --- diff --git a/public/javascripts/menu.js b/public/javascripts/menu.js index d4e8bb65a..9f88f0e0c 100644 --- a/public/javascripts/menu.js +++ b/public/javascripts/menu.js @@ -14,12 +14,14 @@ function openMenu(anchor, menu) { * Callback called when the mouse enters a menu anchor. */ function enterMenuAnchor(event, anchor, menu, delay) { - clearTimeout(menu.timer); + if (!anchor.hasClassName("disabled")) { + clearTimeout(menu.timer); - if (delay > 0) { - menu.timer = setTimeout(function () { openMenu(anchor, menu) }, delay); - } else { - openMenu(event, menu); + if (delay > 0) { + menu.timer = setTimeout(function () { openMenu(anchor, menu) }, delay); + } else { + openMenu(event, menu); + } } }