Skip to content

Commit 4bd4bbc

Browse files
authored
Increase minimum jQuery version to latest in the 1.x series (select2#5525)
* Remove Utils.appendMany
1 parent ab6f846 commit 4bd4bbc

8 files changed

Lines changed: 11013 additions & 9426 deletions

File tree

src/js/select2/data/array.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ define([
7070
if (item.children) {
7171
var $children = this.convertToOptions(item.children);
7272

73-
Utils.appendMany($option, $children);
73+
$option.append($children);
7474
}
7575

7676
$options.push($option);

src/js/select2/data/select.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ define([
151151
};
152152

153153
SelectAdapter.prototype.addOptions = function ($options) {
154-
Utils.appendMany(this.$element, $options);
154+
this.$element.append($options);
155155
};
156156

157157
SelectAdapter.prototype.option = function (data) {

src/js/select2/selection/multiple.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ define([
109109

110110
var $rendered = this.$selection.find('.select2-selection__rendered');
111111

112-
Utils.appendMany($rendered, $selections);
112+
$rendered.append($selections);
113113
};
114114

115115
return MultipleSelection;

src/js/select2/utils.js

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -255,23 +255,6 @@ define([
255255
});
256256
};
257257

258-
// Append an array of jQuery nodes to a given element.
259-
Utils.appendMany = function ($element, $nodes) {
260-
// jQuery 1.7.x does not support $.fn.append() with an array
261-
// Fall back to a jQuery object collection using $.fn.add()
262-
if ($.fn.jquery.substr(0, 3) === '1.7') {
263-
var $jqNodes = $();
264-
265-
$.map($nodes, function (node) {
266-
$jqNodes = $jqNodes.add(node);
267-
});
268-
269-
$nodes = $jqNodes;
270-
}
271-
272-
$element.append($nodes);
273-
};
274-
275258
// Cache objects in Utils.__cache instead of $.data (see #4346)
276259
Utils.__cache = {};
277260

tests/integration-jq1.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<div id="qunit-fixture"></div>
1010

1111
<script src="vendor/qunit-1.23.1.js" type="text/javascript"></script>
12-
<script src="vendor/jquery-1.7.2.js" type="text/javascript"></script>
12+
<script src="vendor/jquery-1.12.4.js" type="text/javascript"></script>
1313
<script src="../dist/js/select2.full.js" type="text/javascript"></script>
1414

1515
<script src="helpers.js" type="text/javascript"></script>

tests/unit-jq1.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
</div>
5252

5353
<script src="vendor/qunit-1.23.1.js" type="text/javascript"></script>
54-
<script src="vendor/jquery-1.7.2.js" type="text/javascript"></script>
54+
<script src="vendor/jquery-1.12.4.js" type="text/javascript"></script>
5555
<script src="../dist/js/select2.full.js" type="text/javascript"></script>
5656

5757
<script src="helpers.js" type="text/javascript"></script>

0 commit comments

Comments
 (0)