Skip to content
Permalink
Browse files

Menu: Added focusing first menu item when menu receives focus and col…

…lapseAll when menu loses focus (blur).
  • Loading branch information
kborchers committed Jul 26, 2011
1 parent f890911 commit e16e99a154d7f3bdbc7ffe56e5c74e9fe90bbd6b
Showing with 12 additions and 0 deletions.
  1. +12 −0 ui/jquery.ui.menu.js
@@ -71,6 +71,18 @@ $.widget( "ui.menu", {
if ( target.length ) {
self.blur( event );
}
})
.bind( "focus.menu", function( event ) {
if ( self.options.disabled ) {
return;
}
self.focus( event, $( event.target ).children( ".ui-menu-item:first" ) );
})
.bind( "blur.menu", function( event ) {
if ( self.options.disabled ) {
return;
}
self.collapseAll( event );
});
this.refresh();

0 comments on commit e16e99a

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