Skip to content

Commit

Permalink
Added insertTag to control the tag position
Browse files Browse the repository at this point in the history
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 #3420
This closes #4008
  • Loading branch information
stretch4x4 authored and kevin-brown committed Jan 4, 2016
1 parent 63d531a commit e842797
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/js/select2/data/tags.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ define([
this.createTag = createTag;
}

var insertTag = options.get('insertTag');

if (insertTag !== undefined) {
this.insertTag = insertTag;
}

decorated.call(this, $element, options);

if ($.isArray(tags)) {
Expand Down

0 comments on commit e842797

Please sign in to comment.