},
_suggest: function( items ) {
- var ul = this.menu.element.empty();
+ var self = this,
+ ul = this.menu.element.empty();
$.each( items, function( index, item ) {
- $( "<li></li>" )
- .data( "item.autocomplete", item )
- .append( "<a>" + item.label + "</a>" )
- .appendTo( ul );
+ self._renderItem( ul, item );
});
this.menu.refresh();
this.menu.element.show();
}
},
+ _renderItem: function( ul, item) {
+ return $( "<li></li>" )
+ .data( "item.autocomplete", item )
+ .append( "<a>" + item.label + "</a>" )
+ .appendTo( ul );
+ },
+
_move: function( direction, event ) {
if ( !this.menu.element.is(":visible") ) {
this.search( null, event );