mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Menu: Change first() and last() to isFirstItem() and isLastItem()
This commit is contained in:
parent
c88add2269
commit
f0007ec745
4
ui/jquery.ui.autocomplete.js
vendored
4
ui/jquery.ui.autocomplete.js
vendored
@ -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;
|
||||
|
8
ui/jquery.ui.menu.js
vendored
8
ui/jquery.ui.menu.js
vendored
@ -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() ) {
|
||||
|
Loading…
Reference in New Issue
Block a user