Skip to content

Commit f0007ec

Browse files
committed
Menu: Change first() and last() to isFirstItem() and isLastItem()
1 parent c88add2 commit f0007ec

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

ui/jquery.ui.autocomplete.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -473,8 +473,8 @@ $.widget( "ui.autocomplete", {
473473
this.search( null, event );
474474
return;
475475
}
476-
if ( this.menu.first() && /^previous/.test(direction) ||
477-
this.menu.last() && /^next/.test(direction) ) {
476+
if ( this.menu.isFirstItem() && /^previous/.test(direction) ||
477+
this.menu.isLastItem() && /^next/.test(direction) ) {
478478
this._value( this.term );
479479
this.menu.blur();
480480
return;

ui/jquery.ui.menu.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -447,11 +447,11 @@ $.widget( "ui.menu", {
447447
this._move( "prev", "last", event );
448448
},
449449

450-
first: function() {
450+
isFirstItem: function() {
451451
return this.active && !this.active.prevAll( ".ui-menu-item" ).length;
452452
},
453453

454-
last: function() {
454+
isLastItem: function() {
455455
return this.active && !this.active.nextAll( ".ui-menu-item" ).length;
456456
},
457457

@@ -480,7 +480,7 @@ $.widget( "ui.menu", {
480480
this.focus( event, this.activeMenu.children( ".ui-menu-item" ).first() );
481481
return;
482482
}
483-
if ( this.last() ) {
483+
if ( this.isLastItem() ) {
484484
return;
485485
}
486486
if ( this._hasScroll() ) {
@@ -504,7 +504,7 @@ $.widget( "ui.menu", {
504504
this.focus( event, this.activeMenu.children( ".ui-menu-item" ).first() );
505505
return;
506506
}
507-
if ( this.first() ) {
507+
if ( this.isFirstItem() ) {
508508
return;
509509
}
510510
if ( this._hasScroll() ) {

0 commit comments

Comments
 (0)