From ac0ba26afc1fe5f7daf1d7f967301470b461772c Mon Sep 17 00:00:00 2001 From: patdenice Date: Mon, 7 Mar 2011 00:58:34 +0000 Subject: Update jQuery UI to 1.8.10. Improve jquery ui management in template class. git-svn-id: http://piwigo.org/svn/trunk@9559 68402e56-0260-453c-a942-63ccdbb3a9ee --- themes/default/js/ui/jquery.ui.autocomplete.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'themes/default/js/ui/jquery.ui.autocomplete.js') diff --git a/themes/default/js/ui/jquery.ui.autocomplete.js b/themes/default/js/ui/jquery.ui.autocomplete.js index 576feee66..718bfe5b9 100644 --- a/themes/default/js/ui/jquery.ui.autocomplete.js +++ b/themes/default/js/ui/jquery.ui.autocomplete.js @@ -1,5 +1,5 @@ /* - * jQuery UI Autocomplete 1.8.9 + * jQuery UI Autocomplete 1.8.10 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) * Dual licensed under the MIT or GPL Version 2 licenses. @@ -14,6 +14,9 @@ */ (function( $, undefined ) { +// used to prevent race conditions with remote data sources +var requestIndex = 0; + $.widget( "ui.autocomplete", { options: { appendTo: "body", @@ -256,17 +259,16 @@ $.widget( "ui.autocomplete", { url: url, data: request, dataType: "json", - success: function( data, status, xhr ) { - if ( xhr === self.xhr ) { + autocompleteRequest: ++requestIndex, + success: function( data, status ) { + if ( this.autocompleteRequest === requestIndex ) { response( data ); } - self.xhr = null; }, - error: function( xhr ) { - if ( xhr === self.xhr ) { + error: function() { + if ( this.autocompleteRequest === requestIndex ) { response( [] ); } - self.xhr = null; } }); }; -- cgit v1.2.3