Skip to content

Instantly share code, notes, and snippets.

@sgharms
Created December 30, 2012 22:29
Show Gist options
  • Save sgharms/4415684 to your computer and use it in GitHub Desktop.
Save sgharms/4415684 to your computer and use it in GitHub Desktop.
_move: function( direction, filter, event ) {
var next, wrapItem;
var activeSubmenu = this.active;
var activeSubmenusParentMenubarItem = activeSubmenu.closest( ".ui-menubar-item" );
//var nextSelection
debugger;
if ( this.open ) {
next = [ direction + "All" ]( this.options.items ).first().children( ".ui-menu" ).eq( 0 );
wrapItem = this.menuItems[ filter ]().children( ".ui-menu" ).eq( 0 );
} else {
if ( event ) {
next = $( event.target ).closest( ".ui-menubar-item" )[ direction + "All" ]( this.options.items ).children( ".ui-menubar-link" ).eq( 0 );
wrapItem = this.menuItems[ filter ]().children( ".ui-menubar-link" ).eq( 0 );
} else {
next = wrapItem = this.menuItems.children( "a" ).eq( 0 );
}
}
if ( next.length ) {
if ( this.open ) {
this._open( event, next );
} else {
next.removeAttr( "tabIndex")[0].focus();
}
} else {
if ( this.open ) {
this._open( event, wrapItem );
} else {
wrapItem.removeAttr( "tabIndex")[0].focus();
}
}
}
@teng315
Copy link

teng315 commented Apr 25, 2013

thanks.
i used this plugin, but I found a problem:
when an item in a drop-down sub menu, click on it, the menu will closed.
I don't need it, how to do it, thank you again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment