mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Menu: Added focusing first menu item when menu receives focus and collapseAll when menu loses focus (blur).
This commit is contained in:
parent
f89091105f
commit
e16e99a154
12
ui/jquery.ui.menu.js
vendored
12
ui/jquery.ui.menu.js
vendored
@ -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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user