From 04a6535bd592033fea4821e8959f84c269ee117b Mon Sep 17 00:00:00 2001 From: rvignacio Date: Sat, 23 Mar 2013 17:26:37 -0300 Subject: [PATCH] Added ajax.transport support to default options --- select2.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/select2.js b/select2.js index ac542afc..85730cce 100644 --- a/select2.js +++ b/select2.js @@ -355,7 +355,7 @@ the specific language governing permissions and limitations under the Apache Lic var requestNumber = requestSequence, // this request's sequence number data = options.data, // ajax data function url = ajaxUrl, // ajax url string or function - transport = options.transport || $.ajax, + transport = options.transport, type = options.type || 'GET', // set type of request (GET or POST) params = {}; @@ -731,7 +731,7 @@ the specific language governing permissions and limitations under the Apache Lic }); } - opts = $.extend({}, { + opts = $.extend(true, {}, { populateResults: function(container, results, query) { var populate, data, result, children, id=this.opts.id, self=this; @@ -2754,7 +2754,12 @@ the specific language governing permissions and limitations under the Apache Lic blurOnChange: false, selectOnBlur: false, adaptContainerCssClass: function(c) { return c; }, - adaptDropdownCssClass: function(c) { return null; } + adaptDropdownCssClass: function(c) { return null; }, + ajax: { + transport: function(options) { + return $.ajax(options); + } + } }; // exports