From cca1c8d6feec0ba1980cd49fa6dea5b527848fcf Mon Sep 17 00:00:00 2001 From: Carlos Fagiani Junior Date: Wed, 21 Jun 2017 14:25:27 -0300 Subject: [PATCH 1/4] andSelf is deprecated in jquery3, changed to addBack --- js/tag-it.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/js/tag-it.js b/js/tag-it.js index 078c264f..a74117a6 100644 --- a/js/tag-it.js +++ b/js/tag-it.js @@ -121,7 +121,7 @@ this.options.singleFieldNode = this.element; this.element.addClass('tagit-hidden-field'); } else { - this.tagList = this.element.find('ul, ol').andSelf().last(); + this.tagList = this.element.find('ul, ol').addBack().last(); } this.tagInput = $('').addClass('ui-widget-content'); @@ -588,4 +588,3 @@ }); })(jQuery); - From d58bb7941a053be7a88a6837d52c2cff0eaf3b0d Mon Sep 17 00:00:00 2001 From: Carlos Fagiani Junior Date: Wed, 28 Jun 2017 17:04:14 -0300 Subject: [PATCH 2/4] replace andSelf with addBack --- js/tag-it.min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/tag-it.min.js b/js/tag-it.min.js index fd6140c8..c372f620 100644 --- a/js/tag-it.min.js +++ b/js/tag-it.min.js @@ -1,5 +1,5 @@ (function(b){b.widget("ui.tagit",{options:{allowDuplicates:!1,caseSensitive:!0,fieldName:"tags",placeholderText:null,readOnly:!1,removeConfirmation:!1,tagLimit:null,availableTags:[],autocomplete:{},showAutocompleteOnFocus:!1,allowSpaces:!1,singleField:!1,singleFieldDelimiter:",",singleFieldNode:null,animate:!0,tabIndex:null,beforeTagAdded:null,afterTagAdded:null,beforeTagRemoved:null,afterTagRemoved:null,onTagClicked:null,onTagLimitExceeded:null,onTagAdded:null,onTagRemoved:null,tagSource:null},_create:function(){var a= -this;this.element.is("input")?(this.tagList=b("").insertAfter(this.element),this.options.singleField=!0,this.options.singleFieldNode=this.element,this.element.addClass("tagit-hidden-field")):this.tagList=this.element.find("ul, ol").andSelf().last();this.tagInput=b('').addClass("ui-widget-content");this.options.readOnly&&this.tagInput.attr("disabled","disabled");this.options.tabIndex&&this.tagInput.attr("tabindex",this.options.tabIndex);this.options.placeholderText&&this.tagInput.attr("placeholder", +this;this.element.is("input")?(this.tagList=b("").insertAfter(this.element),this.options.singleField=!0,this.options.singleFieldNode=this.element,this.element.addClass("tagit-hidden-field")):this.tagList=this.element.find("ul, ol").addBack().last();this.tagInput=b('').addClass("ui-widget-content");this.options.readOnly&&this.tagInput.attr("disabled","disabled");this.options.tabIndex&&this.tagInput.attr("tabindex",this.options.tabIndex);this.options.placeholderText&&this.tagInput.attr("placeholder", this.options.placeholderText);this.options.autocomplete.source||(this.options.autocomplete.source=function(a,e){var d=a.term.toLowerCase(),c=b.grep(this.options.availableTags,function(a){return 0===a.toLowerCase().indexOf(d)});this.options.allowDuplicates||(c=this._subtractArray(c,this.assignedTags()));e(c)});this.options.showAutocompleteOnFocus&&(this.tagInput.focus(function(b,d){a._showAutocomplete()}),"undefined"===typeof this.options.autocomplete.minLength&&(this.options.autocomplete.minLength= 0));b.isFunction(this.options.autocomplete.source)&&(this.options.autocomplete.source=b.proxy(this.options.autocomplete.source,this));b.isFunction(this.options.tagSource)&&(this.options.tagSource=b.proxy(this.options.tagSource,this));this.tagList.addClass("tagit").addClass("ui-widget ui-widget-content ui-corner-all").append(b('
  • ').append(this.tagInput)).click(function(d){var c=b(d.target);c.hasClass("tagit-label")?(c=c.closest(".tagit-choice"),c.hasClass("removed")||a._trigger("onTagClicked", d,{tag:c,tagLabel:a.tagLabel(c)})):a.tagInput.focus()});var c=!1;if(this.options.singleField)if(this.options.singleFieldNode){var d=b(this.options.singleFieldNode),f=d.val().split(this.options.singleFieldDelimiter);d.val("");b.each(f,function(b,d){a.createTag(d,null,!0);c=!0})}else this.options.singleFieldNode=b(''),this.tagList.after(this.options.singleFieldNode);c||this.tagList.children("li").each(function(){b(this).hasClass("tagit-new")|| From caed4655d784be1acfd409a0bbea30e649e11553 Mon Sep 17 00:00:00 2001 From: Carlos Fagiani Junior Date: Wed, 28 Jun 2017 17:10:09 -0300 Subject: [PATCH 3/4] update example.html to jquery3 --- examples.html | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/examples.html b/examples.html index 90113216..189cc437 100644 --- a/examples.html +++ b/examples.html @@ -27,8 +27,8 @@ - - + + @@ -52,7 +52,7 @@ singleFieldNode: $('#mySingleField') }); - // singleFieldTags2 is an INPUT element, rather than a UL as in the other + // singleFieldTags2 is an INPUT element, rather than a UL as in the other // examples, so it automatically defaults to singleField. $('#singleFieldTags2').tagit({ availableTags: sampleTags @@ -132,7 +132,7 @@ availableTags: sampleTags, removeConfirmation: true }); - + }); @@ -141,15 +141,15 @@ Fork me on GitHub -
    -