max-favilli/tagmanager — pull request #172 by Asgaroth (2013-11-08 17:27:37+00:00)
Title: Added event on duplicated tag, and fixed returning undefiend from constructor

Added tm:duplicated event, thrown when there was a duplicated tag (obviously), this allows the user to execute some action, and we should probably make the animation optional, and let the user define what to do using this event.

This also helps integrating with twitter typeahead.js, there is an issue that when there is a duplicated tag, the original field gets its value cleared. but the typeahead.js hint is still shown, which is inconsistent. to fix that you can add:

```javascript
$('#someid').tagsManager({
tagsContainer: container
}).on('tm:pushed tm:duplicated', function(){
// update typeahead hint
$('#someid').typeahead('setQuery', '');
});
```

That will clear the typeahead hint once an action is taken by tagsManager on the field.

Also fixed the issue that the constructor was not returning anything.