Skip to content

Commit d90cc5e

Browse files
author
Tomas Kirda
committed
Rev for 1.2.13 release
1 parent 2a0f1f7 commit d90cc5e

File tree

4 files changed

+13
-7
lines changed

4 files changed

+13
-7
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "devbridge-autocomplete",
3-
"version": "1.2.12",
3+
"version": "1.2.13",
44
"homepage": "https://github.com/devbridge/jQuery-Autocomplete",
55
"authors": [
66
"Tomas Kirda"

devbridge-autocomplete.jquery.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"ajax",
77
"autocomplete"
88
],
9-
"version": "1.2.12",
9+
"version": "1.2.13",
1010
"author": {
1111
"name": "Tomas Kirda",
1212
"url": "https://github.com/tkirda"

dist/jquery.autocomplete.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Ajax Autocomplete for jQuery, version 1.2.12
2+
* Ajax Autocomplete for jQuery, version 1.2.13
33
* (c) 2014 Tomas Kirda
44
*
55
* Ajax Autocomplete for jQuery is freely distributable under the terms of an MIT-style license.
@@ -247,6 +247,7 @@
247247
disable: function () {
248248
var that = this;
249249
that.disabled = true;
250+
clearInterval(that.onChangeInterval);
250251
if (that.currentRequest) {
251252
that.currentRequest.abort();
252253
}
@@ -532,6 +533,10 @@
532533
options.params[options.paramName] = q;
533534
params = options.ignoreParams ? null : options.params;
534535

536+
if (options.onSearchStart.call(that.element, options.params) === false) {
537+
return;
538+
}
539+
535540
if (that.isLocal) {
536541
response = that.getSuggestionsLocal(q);
537542
} else {
@@ -545,10 +550,8 @@
545550
if (response && $.isArray(response.suggestions)) {
546551
that.suggestions = response.suggestions;
547552
that.suggest();
553+
options.onSearchComplete.call(that.element, q, response.suggestions);
548554
} else if (!that.isBadQuery(q)) {
549-
if (options.onSearchStart.call(that.element, options.params) === false) {
550-
return;
551-
}
552555
if (that.currentRequest) {
553556
that.currentRequest.abort();
554557
}
@@ -571,6 +574,8 @@
571574
}).fail(function (jqXHR, textStatus, errorThrown) {
572575
options.onSearchError.call(that.element, q, jqXHR, textStatus, errorThrown);
573576
});
577+
} else {
578+
options.onSearchComplete.call(that.element, q, []);
574579
}
575580
},
576581

@@ -595,6 +600,7 @@
595600
var that = this;
596601
that.visible = false;
597602
that.selectedIndex = -1;
603+
clearInterval(that.onChangeInterval);
598604
$(that.suggestionsContainer).hide();
599605
that.signalHint(null);
600606
},

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "devbridge-autocomplete",
3-
"version": "1.2.12",
3+
"version": "1.2.13",
44
"description": "Autocomplete provides suggestions while you type into the text field.",
55
"homepage": "https://github.com/devbridge/jQuery-Autocomplete",
66
"author": "Tomas Kirda (https://twitter.com/tkirda)",

0 commit comments

Comments
 (0)