Skip to content
Permalink
Browse files

Menu: Make check for click outside of menu a function which can be ov…

…erridden. Fixes #8929 - Menu needs adjustement for use in Selectmenu
  • Loading branch information
kborchers committed Aug 1, 2013
1 parent 5aa106a commit cceb163548eea78525a3a60ada95a5af6e3ddf25
Showing with 5 additions and 1 deletion.
  1. +5 −1 ui/jquery.ui.menu.js
@@ -130,7 +130,7 @@ $.widget( "ui.menu", {
// Clicks outside of a menu collapse any open menus
this._on( this.document, {
click: function( event ) {
if ( !$( event.target ).closest( ".ui-menu" ).length ) {
if ( this._closeOnDocumentClick( event ) ) {
this.collapseAll( event );
}

@@ -502,6 +502,10 @@ $.widget( "ui.menu", {
.removeClass( "ui-state-active" );
},

_closeOnDocumentClick: function( event ) {
return !$( event.target ).closest( ".ui-menu" ).length;
},

collapse: function( event ) {
var newItem = this.active &&
this.active.parent().closest( ".ui-menu-item", this.element );

0 comments on commit cceb163

Please sign in to comment.
You can’t perform that action at this time.