Skip to content

Commit a6edacc

Browse files
committed
Merge branch 'master' of git://github.com/ivaynberg/select2
2 parents 0160b36 + b3d9e7c commit a6edacc

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

select2.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@
212212
function ajax(options) {
213213
var timeout, // current scheduled but not yet executed request
214214
requestSequence = 0, // sequence used to drop out-of-order responses
215+
handler = null,
215216
quietMillis = options.quietMillis || 100;
216217

217218
return function (query) {
@@ -224,7 +225,10 @@
224225

225226
data = data.call(this, query.term, query.page);
226227

227-
transport.call(null, {
228+
if( null !== handler){
229+
handler.abort();
230+
}
231+
handler = transport.call(null, {
228232
url: options.url,
229233
dataType: options.dataType,
230234
data: data,

0 commit comments

Comments
 (0)