themes/base: allow closing menus by clicking into the body (#97)
authorJo-Philipp Wich <jow@openwrt.org>
Thu, 25 Mar 2010 13:41:55 +0000 (13:41 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Thu, 25 Mar 2010 13:41:55 +0000 (13:41 +0000)
themes/base/htdocs/luci-static/resources/Dropdowns.js

index 8c07a6f2fcd8dee7bf63707622645b9900273c1f..a8d12b959ccc386aa437136889ef5bef4ca0b33c 100644 (file)
@@ -187,6 +187,14 @@ function initDropdowns() {
                        }
                }
        }
+
+       XHTML1.addEventListener(document, "click", function() {
+               if (delayHideTimerId) {
+                       clearTimeout(delayHideTimerId);
+                       delayHideTimerId = 0;
+                       delayHide();
+               }
+       });
 }
 
 if(XHTML1.isDOMSupported()) {