Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix issue where "afterTagRemoved" fires at wrong time if animating

  • Loading branch information...
commit 38bb8c239a8466c30e9143d7d55ecb03eb429572 1 parent 2c65818
Nolan Lawson nolanlawson authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 js/tag-it.js
4 js/tag-it.js
View
@@ -500,16 +500,18 @@
tag.addClass('removed'); // Excludes this tag from _tags.
var hide_args = this._effectExists('blind') ? ['blind', {direction: 'horizontal'}, 'fast'] : ['fast'];
+ var thisTag = this;
hide_args.push(function() {
tag.remove();
+ thisTag._trigger('afterTagRemoved', null, {tag: tag, tagLabel: thisTag.tagLabel(tag)});
});
tag.fadeOut('fast').hide.apply(tag, hide_args).dequeue();
} else {
tag.remove();
+ this._trigger('afterTagRemoved', null, {tag: tag, tagLabel: this.tagLabel(tag)});
}
- this._trigger('afterTagRemoved', null, {tag: tag, tagLabel: this.tagLabel(tag)});
},
removeTagByLabel: function(tagLabel, animate) {
Please sign in to comment.
Something went wrong with that request. Please try again.