Add new option 'createTagForce'
This commit is contained in:
parent
d2f3937764
commit
85132b45fe
4
dist/js/select2.full.js
vendored
4
dist/js/select2.full.js
vendored
@ -3687,6 +3687,8 @@ S2.define('select2/data/tags',[
|
|||||||
}
|
}
|
||||||
|
|
||||||
function wrapper (obj, child) {
|
function wrapper (obj, child) {
|
||||||
|
var createTagForce = self.options.get('createTagForce') || false;
|
||||||
|
|
||||||
var data = obj.results;
|
var data = obj.results;
|
||||||
|
|
||||||
for (var i = 0; i < data.length; i++) {
|
for (var i = 0; i < data.length; i++) {
|
||||||
@ -3704,7 +3706,7 @@ S2.define('select2/data/tags',[
|
|||||||
|
|
||||||
var checkText = optionText === paramsTerm;
|
var checkText = optionText === paramsTerm;
|
||||||
|
|
||||||
if (checkText || checkChildren) {
|
if (!createTagForce && (checkText || checkChildren)) {
|
||||||
if (child) {
|
if (child) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
2
dist/js/select2.full.min.js
vendored
2
dist/js/select2.full.min.js
vendored
File diff suppressed because one or more lines are too long
4
dist/js/select2.js
vendored
4
dist/js/select2.js
vendored
@ -3687,6 +3687,8 @@ S2.define('select2/data/tags',[
|
|||||||
}
|
}
|
||||||
|
|
||||||
function wrapper (obj, child) {
|
function wrapper (obj, child) {
|
||||||
|
var createTagForce = self.options.get('createTagForce') || false;
|
||||||
|
|
||||||
var data = obj.results;
|
var data = obj.results;
|
||||||
|
|
||||||
for (var i = 0; i < data.length; i++) {
|
for (var i = 0; i < data.length; i++) {
|
||||||
@ -3704,7 +3706,7 @@ S2.define('select2/data/tags',[
|
|||||||
|
|
||||||
var checkText = optionText === paramsTerm;
|
var checkText = optionText === paramsTerm;
|
||||||
|
|
||||||
if (checkText || checkChildren) {
|
if (!createTagForce && (checkText || checkChildren)) {
|
||||||
if (child) {
|
if (child) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
2
dist/js/select2.min.js
vendored
2
dist/js/select2.min.js
vendored
File diff suppressed because one or more lines are too long
4
src/js/select2/data/tags.js
vendored
4
src/js/select2/data/tags.js
vendored
@ -41,6 +41,8 @@ define([
|
|||||||
}
|
}
|
||||||
|
|
||||||
function wrapper (obj, child) {
|
function wrapper (obj, child) {
|
||||||
|
var createTagForce = self.options.get('createTagForce') || false;
|
||||||
|
|
||||||
var data = obj.results;
|
var data = obj.results;
|
||||||
|
|
||||||
for (var i = 0; i < data.length; i++) {
|
for (var i = 0; i < data.length; i++) {
|
||||||
@ -58,7 +60,7 @@ define([
|
|||||||
|
|
||||||
var checkText = optionText === paramsTerm;
|
var checkText = optionText === paramsTerm;
|
||||||
|
|
||||||
if (checkText || checkChildren) {
|
if (!createTagForce && (checkText || checkChildren)) {
|
||||||
if (child) {
|
if (child) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user