Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

update example to get tag labels appropriately

  • Loading branch information...
commit ab0f4e1e5b758308410ac7e9d963289af91fcd37 1 parent a2048c8
@aehlke aehlke authored
Showing with 5 additions and 4 deletions.
  1. +5 −4 examples.html
View
9 examples.html
@@ -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));
});
//-------------------------------
Please sign in to comment.
Something went wrong with that request. Please try again.