From f0007ec74526979837c93be13bf181b3cf57c2ce Mon Sep 17 00:00:00 2001 From: kborchers Date: Fri, 23 Dec 2011 09:48:14 -0600 Subject: [PATCH] Menu: Change first() and last() to isFirstItem() and isLastItem() --- ui/jquery.ui.autocomplete.js | 4 ++-- ui/jquery.ui.menu.js | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ui/jquery.ui.autocomplete.js b/ui/jquery.ui.autocomplete.js index bd415aa2b..c054ba2dd 100644 --- a/ui/jquery.ui.autocomplete.js +++ b/ui/jquery.ui.autocomplete.js @@ -473,8 +473,8 @@ $.widget( "ui.autocomplete", { this.search( null, event ); return; } - if ( this.menu.first() && /^previous/.test(direction) || - this.menu.last() && /^next/.test(direction) ) { + if ( this.menu.isFirstItem() && /^previous/.test(direction) || + this.menu.isLastItem() && /^next/.test(direction) ) { this._value( this.term ); this.menu.blur(); return; diff --git a/ui/jquery.ui.menu.js b/ui/jquery.ui.menu.js index c5d4fd3aa..4fac02d2a 100644 --- a/ui/jquery.ui.menu.js +++ b/ui/jquery.ui.menu.js @@ -447,11 +447,11 @@ $.widget( "ui.menu", { this._move( "prev", "last", event ); }, - first: function() { + isFirstItem: function() { return this.active && !this.active.prevAll( ".ui-menu-item" ).length; }, - last: function() { + isLastItem: function() { return this.active && !this.active.nextAll( ".ui-menu-item" ).length; }, @@ -480,7 +480,7 @@ $.widget( "ui.menu", { this.focus( event, this.activeMenu.children( ".ui-menu-item" ).first() ); return; } - if ( this.last() ) { + if ( this.isLastItem() ) { return; } if ( this._hasScroll() ) { @@ -504,7 +504,7 @@ $.widget( "ui.menu", { this.focus( event, this.activeMenu.children( ".ui-menu-item" ).first() ); return; } - if ( this.first() ) { + if ( this.isFirstItem() ) { return; } if ( this._hasScroll() ) {