Skip to content

Commit

Permalink
update example to get tag labels appropriately
Browse files Browse the repository at this point in the history
  • Loading branch information
aehlke committed Jun 14, 2011
1 parent a2048c8 commit ab0f4e1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions examples.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,20 +66,21 @@
//-------------------------------
// Tag events
//-------------------------------
$('#eventTags').tagit({
var eventTags = $('#eventTags');
eventTags.tagit({
availableTags: sampleTags,
onTagRemoved: function(evt, tag) {
console.log(evt);
alert('This tag is being removed: ' + tag.text());
alert('This tag is being removed: ' + eventTags.tagit('tagLabel', tag));
},
onTagClicked: function(evt, tag) {
console.log(tag);
alert('This tag was clicked: ' + tag.text());
alert('This tag was clicked: ' + eventTags.tagit('tagLabel', tag));
}
}).tagit('option', 'onTagAdded', function(evt, tag) {
// Add this callbackafter we initialize the widget,
// so that onTagAdded doesn't get called on page load.
alert('This tag is being added: ' + tag.text());
alert('This tag is being added: ' + eventTags.tagit('tagLabel', tag));
});

//-------------------------------
Expand Down

0 comments on commit ab0f4e1

Please sign in to comment.