1
0
mirror of synced 2024-11-22 13:06:08 +03:00

Expose createTag as an option

This is a replacement for the old `createSearchChoice` method which
allowed tags to be dynamically created with a custom data object.
This commit is contained in:
Kevin Brown 2015-01-09 10:30:56 -05:00
parent 024d41b412
commit 751fc63169
7 changed files with 33 additions and 3 deletions

View File

@ -2579,6 +2579,12 @@ define('select2/data/tags',[
function Tags (decorated, $element, options) {
var tags = options.get('tags');
var createTag = options.get('createTag');
if (createTag !== undefined) {
this.createTag = createTag;
}
decorated.call(this, $element, options);
if ($.isArray(tags)) {

View File

@ -2579,6 +2579,12 @@ define('select2/data/tags',[
function Tags (decorated, $element, options) {
var tags = options.get('tags');
var createTag = options.get('createTag');
if (createTag !== undefined) {
this.createTag = createTag;
}
decorated.call(this, $element, options);
if ($.isArray(tags)) {

View File

@ -12114,6 +12114,12 @@ define('select2/data/tags',[
function Tags (decorated, $element, options) {
var tags = options.get('tags');
var createTag = options.get('createTag');
if (createTag !== undefined) {
this.createTag = createTag;
}
decorated.call(this, $element, options);
if ($.isArray(tags)) {

File diff suppressed because one or more lines are too long

6
dist/js/select2.js vendored
View File

@ -3007,6 +3007,12 @@ define('select2/data/tags',[
function Tags (decorated, $element, options) {
var tags = options.get('tags');
var createTag = options.get('createTag');
if (createTag !== undefined) {
this.createTag = createTag;
}
decorated.call(this, $element, options);
if ($.isArray(tags)) {

File diff suppressed because one or more lines are too long

View File

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