Skip to content

Commit da54bac

Browse files
author
Tomas Kirda
committed
Add ajaxSettings to src file (was in dist by mistake).
1 parent b6d3f75 commit da54bac

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/jquery.autocomplete.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
var noop = function () { },
5454
that = this,
5555
defaults = {
56+
ajaxSettings: {},
5657
autoSelectFirst: false,
5758
appendTo: document.body,
5859
serviceUrl: null,
@@ -521,7 +522,8 @@
521522
options = that.options,
522523
serviceUrl = options.serviceUrl,
523524
params,
524-
cacheKey;
525+
cacheKey,
526+
ajaxSettings;
525527

526528
options.params[options.paramName] = q;
527529
params = options.ignoreParams ? null : options.params;
@@ -546,12 +548,17 @@
546548
if (that.currentRequest) {
547549
that.currentRequest.abort();
548550
}
549-
that.currentRequest = $.ajax({
551+
552+
ajaxSettings = {
550553
url: serviceUrl,
551554
data: params,
552555
type: options.type,
553556
dataType: options.dataType
554-
}).done(function (data) {
557+
};
558+
559+
$.extend(ajaxSettings, options.ajaxSettings);
560+
561+
that.currentRequest = $.ajax(ajaxSettings).done(function (data) {
555562
var result;
556563
that.currentRequest = null;
557564
result = options.transformResult(data);

0 commit comments

Comments
 (0)