Skip to content

Commit

Permalink
Fix issue where "afterTagRemoved" fires at wrong time if animating
Browse files Browse the repository at this point in the history
  • Loading branch information
nolanlawson committed Feb 12, 2013
1 parent 2c65818 commit 38bb8c2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion js/tag-it.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 38bb8c2

Please sign in to comment.