diff options
Diffstat (limited to 'ui/jquery.ui.autocomplete.js')
-rw-r--r-- | ui/jquery.ui.autocomplete.js | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/ui/jquery.ui.autocomplete.js b/ui/jquery.ui.autocomplete.js index ff132cf8f..38b23fc9d 100644 --- a/ui/jquery.ui.autocomplete.js +++ b/ui/jquery.ui.autocomplete.js @@ -237,9 +237,7 @@ $.widget( "ui.autocomplete", { _suggest: function( items ) { var self = this, ul = this.menu.element.empty(); - $.each( items, function( index, item ) { - self._renderItem( ul, item ); - }); + this._renderMenu( ul, items ); // TODO refresh should check if the active item is still in the dom, removing the need for a manual deactivate this.menu.deactivate(); this.menu.refresh(); @@ -248,6 +246,13 @@ $.widget( "ui.autocomplete", { ul.width( this.element.width() ); } }, + + _renderMenu: function( ul, items ) { + var self = this; + $.each( items, function( index, item ) { + self._renderItem( ul, item ); + }); + }, _renderItem: function( ul, item) { return $( "<li></li>" ) |