Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

…lapseAll when menu loses focus (blur).
  • Loading branch information...
commit e16e99a154d7f3bdbc7ffe56e5c74e9fe90bbd6b 1 parent f890911
@kborchers kborchers authored
Showing with 12 additions and 0 deletions.
  1. +12 −0 ui/jquery.ui.menu.js
View
12 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();
Please sign in to comment.
Something went wrong with that request. Please try again.