From f668b90fa03186ddda6ce834251562cfe85342c2 Mon Sep 17 00:00:00 2001 From: Jan Wielemaker Date: Sun, 29 Apr 2018 13:40:34 +0200 Subject: [PATCH] Fixed .andSelf() deprecated issue #396 --- js/tag-it.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/js/tag-it.js b/js/tag-it.js index 078c264f..57fddaa3 100644 --- a/js/tag-it.js +++ b/js/tag-it.js @@ -121,7 +121,11 @@ this.options.singleFieldNode = this.element; this.element.addClass('tagit-hidden-field'); } else { - this.tagList = this.element.find('ul, ol').andSelf().last(); + if ($.isFunction($.fn.addBack)) { + this.tagList = this.element.find('ul, ol').addBack().last(); + } else { + this.tagList = this.element.find('ul, ol').andSelf().last(); + } } this.tagInput = $('').addClass('ui-widget-content');