}
var target = $( event.target ).closest( ".ui-menu-item" );
if ( target.length && target.parent()[0] === self.element[0] ) {
- self.activate( event, target );
+ self.focus( event, target );
}
})
.bind("mouseout.menu", function( event ) {
}
var target = $( event.target ).closest( ".ui-menu-item" );
if ( target.length && target.parent()[0] === self.element[0] ) {
- self.deactivate( event );
+ self.blur( event );
}
});
this.refresh();
.attr( "tabIndex", -1 );
},
- activate: function( event, item ) {
+ focus: function( event, item ) {
var self = this;
- this.deactivate();
+ this.blur();
if ( this._hasScroll() ) {
var borderTop = parseFloat( $.curCSS( this.element[0], "borderTopWidth", true) ) || 0,
paddingtop = parseFloat( $.curCSS( this.element[0], "paddingTop", true) ) || 0,
this._trigger( "focus", event, { item: item } );
},
- deactivate: function(event) {
+ blur: function(event) {
if (!this.active) {
return;
}
_move: function(direction, edge, filter, event) {
if ( !this.active ) {
- this.activate( event, this.element.children(edge)[filter]() );
+ this.focus( event, this.element.children(edge)[filter]() );
return;
}
var next = this.active[ direction + "All" ]( ".ui-menu-item" ).eq( 0 );
if ( next.length ) {
- this.activate( event, next );
+ this.focus( event, next );
} else {
- this.activate( event, this.element.children(edge)[filter]() );
+ this.focus( event, this.element.children(edge)[filter]() );
}
},
nextPage: function( event ) {
if ( this._hasScroll() ) {
if ( !this.active || this.last() ) {
- this.activate( event, this.element.children( ".ui-menu-item" ).first() );
+ this.focus( event, this.element.children( ".ui-menu-item" ).first() );
return;
}
var base = this.active.offset().top,
return $( this ).offset().top - base - height < 0;
});
- this.activate( event, result );
+ this.focus( event, result );
} else {
- this.activate( event, this.element.children( ".ui-menu-item" )
+ this.focus( event, this.element.children( ".ui-menu-item" )
[ !this.active || this.last() ? "first" : "last" ]() );
}
},
previousPage: function( event ) {
if ( this._hasScroll() ) {
if ( !this.active || this.first() ) {
- this.activate( event, this.element.children( ".ui-menu-item" ).last() );
+ this.focus( event, this.element.children( ".ui-menu-item" ).last() );
return;
}
return $(this).offset().top - base + height > 0;
});
- this.activate( event, result );
+ this.focus( event, result );
} else {
- this.activate( event, this.element.children( ".ui-menu-item" )
+ this.focus( event, this.element.children( ".ui-menu-item" )
[ !this.active || this.first() ? ":last" : ":first" ]() );
}
},