1
0
mirror of synced 2024-11-29 16:16:02 +03:00

Added insertTag to control the tag position

This adds an option called `insertTag` that controls the location within
the results where the tag is inserted. The function should take in the
results array and the tag, and should modify the array in-place to add
the tag to the results.

This closes https://github.com/select2/select2/issues/3420
This closes https://github.com/select2/select2/pull/4008
This commit is contained in:
Stretch 2016-01-03 19:06:13 -05:00 committed by Kevin Brown
parent 63d531a9c0
commit e842797aaf

View File

@ -10,6 +10,12 @@ define([
this.createTag = createTag; this.createTag = createTag;
} }
var insertTag = options.get('insertTag');
if (insertTag !== undefined) {
this.insertTag = insertTag;
}
decorated.call(this, $element, options); decorated.call(this, $element, options);
if ($.isArray(tags)) { if ($.isArray(tags)) {