Menu: Added close on click outside using technique from popup

This commit is contained in:
kborchers 2011-07-09 23:30:35 -05:00 committed by Jörn Zaefferer
parent 163d867a1f
commit 9f5050ee06

View File

@ -170,6 +170,14 @@ $.widget( "ui.menu", {
} }
} }
}); });
this._bind( document, {
click: function( event ) {
if ( !$( event.target ).closest( ".ui-menu" ).length ) {
this.closeAll();
}
}
});
}, },
_destroy: function() { _destroy: function() {