Procházet zdrojové kódy

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.
Kevin Brown před 10 roky
rodič
revize
751fc63169

+ 6 - 0
dist/js/select2.amd.full.js

@@ -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)) {

+ 6 - 0
dist/js/select2.amd.js

@@ -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)) {

+ 6 - 0
dist/js/select2.full.js

@@ -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)) {

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 0
dist/js/select2.full.min.js


+ 6 - 0
dist/js/select2.js

@@ -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)) {

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 0
dist/js/select2.min.js


+ 6 - 0
src/js/select2/data/tags.js

@@ -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)) {

Některé soubory nejsou zobrazeny, neboť je v těchto rozdílových datech změněno mnoho souborů