Skip to content

Commit

Permalink
Added ajax.transport support to default options
Browse files Browse the repository at this point in the history
  • Loading branch information
rvignacio committed Mar 23, 2013
1 parent 4a1c849 commit 04a6535
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions select2.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ the specific language governing permissions and limitations under the Apache Lic
var requestNumber = requestSequence, // this request's sequence number var requestNumber = requestSequence, // this request's sequence number
data = options.data, // ajax data function data = options.data, // ajax data function
url = ajaxUrl, // ajax url string or 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) type = options.type || 'GET', // set type of request (GET or POST)
params = {}; params = {};


Expand Down Expand Up @@ -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) { populateResults: function(container, results, query) {
var populate, data, result, children, id=this.opts.id, self=this; var populate, data, result, children, id=this.opts.id, self=this;


Expand Down Expand Up @@ -2754,7 +2754,12 @@ the specific language governing permissions and limitations under the Apache Lic
blurOnChange: false, blurOnChange: false,
selectOnBlur: false, selectOnBlur: false,
adaptContainerCssClass: function(c) { return c; }, adaptContainerCssClass: function(c) { return c; },
adaptDropdownCssClass: function(c) { return null; } adaptDropdownCssClass: function(c) { return null; },
ajax: {
transport: function(options) {
return $.ajax(options);
}
}
}; };


// exports // exports
Expand Down

0 comments on commit 04a6535

Please sign in to comment.