From: Jo-Philipp Wich Date: Thu, 25 Mar 2010 13:41:55 +0000 (+0000) Subject: themes/base: allow closing menus by clicking into the body (#97) X-Git-Tag: 0.10.0~776 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=3b4292d9971dd216281b9cfe02899f999f862ac4;p=oweals%2Fluci.git themes/base: allow closing menus by clicking into the body (#97) --- diff --git a/themes/base/htdocs/luci-static/resources/Dropdowns.js b/themes/base/htdocs/luci-static/resources/Dropdowns.js index 8c07a6f2f..a8d12b959 100644 --- a/themes/base/htdocs/luci-static/resources/Dropdowns.js +++ b/themes/base/htdocs/luci-static/resources/Dropdowns.js @@ -187,6 +187,14 @@ function initDropdowns() { } } } + + XHTML1.addEventListener(document, "click", function() { + if (delayHideTimerId) { + clearTimeout(delayHideTimerId); + delayHideTimerId = 0; + delayHide(); + } + }); } if(XHTML1.isDOMSupported()) {