From da54bac1ed9c8c9863212236acbe0afb6397a44b Mon Sep 17 00:00:00 2001 From: Tomas Kirda Date: Tue, 26 Aug 2014 13:29:33 -0500 Subject: [PATCH] Add ajaxSettings to src file (was in dist by mistake). --- src/jquery.autocomplete.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/jquery.autocomplete.js b/src/jquery.autocomplete.js index 3fa3a4f..831f5a9 100644 --- a/src/jquery.autocomplete.js +++ b/src/jquery.autocomplete.js @@ -53,6 +53,7 @@ var noop = function () { }, that = this, defaults = { + ajaxSettings: {}, autoSelectFirst: false, appendTo: document.body, serviceUrl: null, @@ -521,7 +522,8 @@ options = that.options, serviceUrl = options.serviceUrl, params, - cacheKey; + cacheKey, + ajaxSettings; options.params[options.paramName] = q; params = options.ignoreParams ? null : options.params; @@ -546,12 +548,17 @@ if (that.currentRequest) { that.currentRequest.abort(); } - that.currentRequest = $.ajax({ + + ajaxSettings = { url: serviceUrl, data: params, type: options.type, dataType: options.dataType - }).done(function (data) { + }; + + $.extend(ajaxSettings, options.ajaxSettings); + + that.currentRequest = $.ajax(ajaxSettings).done(function (data) { var result; that.currentRequest = null; result = options.transformResult(data);