Skip to content

Commit a624417

Browse files
committed
Merge pull request select2#1083 from rvignacio/default_ajax.transport
Added ajax.transport default option
2 parents 74a2805 + 04a6535 commit a624417

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

select2.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ the specific language governing permissions and limitations under the Apache Lic
355355
var requestNumber = requestSequence, // this request's sequence number
356356
data = options.data, // ajax data function
357357
url = ajaxUrl, // ajax url string or function
358-
transport = options.transport || $.ajax,
358+
transport = options.transport,
359359
type = options.type || 'GET', // set type of request (GET or POST)
360360
params = {};
361361

@@ -731,7 +731,7 @@ the specific language governing permissions and limitations under the Apache Lic
731731
});
732732
}
733733

734-
opts = $.extend({}, {
734+
opts = $.extend(true, {}, {
735735
populateResults: function(container, results, query) {
736736
var populate, data, result, children, id=this.opts.id, self=this;
737737

@@ -2754,7 +2754,12 @@ the specific language governing permissions and limitations under the Apache Lic
27542754
blurOnChange: false,
27552755
selectOnBlur: false,
27562756
adaptContainerCssClass: function(c) { return c; },
2757-
adaptDropdownCssClass: function(c) { return null; }
2757+
adaptDropdownCssClass: function(c) { return null; },
2758+
ajax: {
2759+
transport: function(options) {
2760+
return $.ajax(options);
2761+
}
2762+
}
27582763
};
27592764

27602765
// exports

0 commit comments

Comments
 (0)