this.response = function() {
return self._response.apply( self, arguments );
};
- this.menu = $("<ul></ul>")
+ this.menu = $( "<ul></ul>" )
.addClass( "ui-autocomplete" )
.appendTo( this.element.parent() )
.menu({
.removeAttr( "role" )
.removeAttr( "aria-autocomplete" )
.removeAttr( "aria-haspopup" );
- if ( this.menu ) {
- this.menu.element.remove();
- }
+ this.menu.element.remove();
$.Widget.prototype.destroy.call( this );
},
},
_suggest: function( items ) {
- this.menu.element.empty();
- var ul = this.menu.element;
+ var ul = this.menu.element.empty();
$.each( items, function( index, item ) {
$( "<li></li>" )
.data( "item.autocomplete", item )
},
_move: function( direction, event ) {
- if ( !this.menu ) {
+ if ( !this.menu.element.is(":visible") ) {
this.search( null, event );
return;
}