|
@@ -13600,13 +13600,17 @@ define('jquery.select2',[
|
|
|
|
|
|
if (typeof options === 'object') {
|
|
if (typeof options === 'object') {
|
|
this.each(function () {
|
|
this.each(function () {
|
|
- var instance = new Select2($(this), options);
|
|
|
|
|
|
+ var instanceOptions = $.extend({}, options, true);
|
|
|
|
+
|
|
|
|
+ var instance = new Select2($(this), instanceOptions);
|
|
});
|
|
});
|
|
|
|
+
|
|
|
|
+ return this;
|
|
} else if (typeof options === 'string') {
|
|
} else if (typeof options === 'string') {
|
|
var instance = this.data('select2');
|
|
var instance = this.data('select2');
|
|
var args = Array.prototype.slice.call(arguments, 1);
|
|
var args = Array.prototype.slice.call(arguments, 1);
|
|
|
|
|
|
- instance[options](args);
|
|
|
|
|
|
+ return instance[options](args);
|
|
} else {
|
|
} else {
|
|
throw new Error('Invalid arguments for Select2: ' + options);
|
|
throw new Error('Invalid arguments for Select2: ' + options);
|
|
}
|
|
}
|