1
0
mirror of synced 2025-02-16 20:13:16 +03:00

Aborts the ajax call when a new is coming up

This commit is contained in:
Francisco Facioni 2012-05-06 10:37:51 -03:00
parent 011770a5d5
commit 404539e6d3

View File

@ -212,6 +212,7 @@ See the License for the specific language governing permissions and limitations
function ajax(options) {
var timeout, // current scheduled but not yet executed request
requestSequence = 0, // sequence used to drop out-of-order responses
handler = null,
quietMillis = options.quietMillis || 100;
return function (query) {
@ -224,7 +225,10 @@ See the License for the specific language governing permissions and limitations
data = data.call(this, query.term, query.page);
transport.call(null, {
if( null !== handler){
handler.abort();
}
handler = transport.call(null, {
url: options.url,
dataType: options.dataType,
data: data,