aehlke/tag-it — Issue #50: Add after tag added/removed events
Author: campey
Created: 2012-01-18 15:27:36+00:00
State: open

Hi

I just added these events to my local tagit as in the patch below.

Might be useful to someone else, consider merging?

ciao

Campey

```javascript

diff -r e1abd7d74ee7 mm-gae/web/rich/scripts/tagit/tag-it.js
--- a/mm-gae/web/rich/scripts/tagit/tag-it.js	Wed Jan 18 17:06:20 2012 +0200
+++ b/mm-gae/web/rich/scripts/tagit/tag-it.js	Wed Jan 18 17:23:36 2012 +0200
@@ -74,7 +74,9 @@

// Event callbacks.
onTagAdded : null,
+ afterTagAdded : null,
onTagRemoved: null,
+ afterTagRemoved: null,
onTagClicked: null
},

@@ -346,6 +348,8 @@

// insert tag
this._tagInput.parent().before(tag);
+
+ this._trigger('afterTagAdded', null, tag);
},

removeTag: function(tag, animate) {
@@ -371,6 +375,8 @@
} else {
tag.remove();
}
+
+ this._trigger('afterTagRemoved', null, tag);
},

removeAll: function() {
```