Problem with autocomplete and loading-icon
Hi.
I use ajax calls to get my results in autocomplete (I love it!). But its happen very very often, that the loading-icon (class .ui-autocomplete-loading) don't hide after result popup is show up. That happen in 1.9.x and in 1.10.0.
Can anybody help me here? :)
jquery.ui.autocomplete.js:
- _search: function( value ) {
- this.pending++;
- this.element.addClass( "ui-autocomplete-loading" );
- this.cancelSearch = false;
- this.source( { term: value }, this._response() );
- },
- _response: function() {
- var that = this,
- index = ++requestIndex;
- return function( content ) {
- if ( index === requestIndex ) {
- that.__response( content );
- }
- that.pending--;
- if ( !that.pending ) {
- that.element.removeClass( "ui-autocomplete-loading" );
- }
- };
- },