aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorkborchers <kris.borchers@gmail.com>2012-07-09 23:20:43 -0500
committerkborchers <kris.borchers@gmail.com>2012-07-10 00:14:53 -0500
commit019dcc26e307614681a6dfd0fcd9665548cb6ab6 (patch)
tree0812bdc55d8b0f785f880bbff2b4175549a18f22 /ui
parenta79d09a905740ce299f57602144144eee9b03af2 (diff)
downloadjquery-ui-019dcc26e307614681a6dfd0fcd9665548cb6ab6.tar.gz
jquery-ui-019dcc26e307614681a6dfd0fcd9665548cb6ab6.zip
Menu: Remove incorrect scroll check behavior from focus event handler
Diffstat (limited to 'ui')
-rw-r--r--ui/jquery.ui.menu.js22
1 files changed, 5 insertions, 17 deletions
diff --git a/ui/jquery.ui.menu.js b/ui/jquery.ui.menu.js
index 127a09bb5..3658bd8d5 100644
--- a/ui/jquery.ui.menu.js
+++ b/ui/jquery.ui.menu.js
@@ -101,25 +101,13 @@ $.widget( "ui.menu", {
"mouseleave .ui-menu": "collapseAll",
focus: function( event ) {
var menuTop,
- menu = this.element,
- // Default to focusing the first item
- item = menu.children( ".ui-menu-item" ).eq( 0 );
+ item,
+ menu = this.element;
// If there's already an active item, keep it active
- if ( this.active ) {
- item = this.active;
- // If there's no active item and the menu is scrolled,
- // then find the first visible item
- } else if ( this._hasScroll() ) {
- menuTop = menu.offset().top;
- menu.children().each(function() {
- var currentItem = $( this );
- if ( currentItem.offset().top - menuTop >= 0 ) {
- item = currentItem;
- return false;
- }
- });
- }
+ // If not, activate the first item
+ item = this.active || menu.children( ".ui-menu-item" ).eq( 0 );
+
this.focus( event, item );
},
blur: function( event ) {