Author: jleroux Date: Fri Apr 6 09:53:32 2012 New Revision: 1310267 URL: http://svn.apache.org/viewvc?rev=1310267&view=rev Log: "Applied fix from trunk for revision: 1310266" ------------------------------------------------------------------------ r1310266 | jleroux | 2012-04-06 11:48:29 +0200 (ven., 06 avr. 2012) | 3 lines
A patch from Deepak Dixit for "Auto-completer request should be async." https://issues.apache.org/jira/browse/OFBIZ-4780 Fixes a minor issue regarding the pending request count for ajax auto-completer: pending count is used to add and remove the ui-autocomplete-loading class. If we are aborting the request then this count is not updated properly and ui-autocomplete-loading class does not remove from the lookup element hence ajax loader image display continuously if response came. ------------------------------------------------------------------------ Modified: ofbiz/branches/release11.04/ (props changed) ofbiz/branches/release11.04/framework/images/webapp/images/selectall.js Propchange: ofbiz/branches/release11.04/ ------------------------------------------------------------------------------ Merged /ofbiz/trunk:r1310266 Modified: ofbiz/branches/release11.04/framework/images/webapp/images/selectall.js URL: http://svn.apache.org/viewvc/ofbiz/branches/release11.04/framework/images/webapp/images/selectall.js?rev=1310267&r1=1310266&r2=1310267&view=diff ============================================================================== --- ofbiz/branches/release11.04/framework/images/webapp/images/selectall.js (original) +++ ofbiz/branches/release11.04/framework/images/webapp/images/selectall.js Fri Apr 6 09:53:32 2012 @@ -421,9 +421,11 @@ function ajaxAutoCompleter(areaCsvString data: {term : request.term}, beforeSend: function (jqXHR, settings) { //If LAST_AUTOCOMP_REF is not null means an existing ajax auto-completer request is in progress, so need to abort them to prevent inconsistent behavior of autocompleter - if (LAST_AUTOCOMP_REF != null) { + if (LAST_AUTOCOMP_REF != null && LAST_AUTOCOMP_REF.readyState != 4) { var oldRef = LAST_AUTOCOMP_REF; oldRef.abort(); + //Here we are aborting the LAST_AUTOCOMP_REF so need to call the response method so that auto-completer pending request count handle in proper way + response( [] ); } LAST_AUTOCOMP_REF= jqXHR; },

