From 9f5050ee063ed4c9e6191fc58ef151254cf54e76 Mon Sep 17 00:00:00 2001 From: kborchers Date: Sat, 9 Jul 2011 23:30:35 -0500 Subject: [PATCH] Menu: Added close on click outside using technique from popup --- ui/jquery.ui.menu.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ui/jquery.ui.menu.js b/ui/jquery.ui.menu.js index b93c95531..770e0252a 100644 --- a/ui/jquery.ui.menu.js +++ b/ui/jquery.ui.menu.js @@ -170,6 +170,14 @@ $.widget( "ui.menu", { } } }); + + this._bind( document, { + click: function( event ) { + if ( !$( event.target ).closest( ".ui-menu" ).length ) { + this.closeAll(); + } + } + }); }, _destroy: function() { -- 2.39.5