'style' is now cleared after highlight animation, so it no longer messes with other things you want to style.
features:
each tag label is now marked as 'tagit-label' class - simplifies use of ellipsis for tags and etc.
option 'editable', methods _edit and _postEdit were added
Edit logic:
if 'editable=true' click on a tag:
hides corresponding tagit-label using class 'hidden'
adds an input with class 'tagit-edit' and width of hidden tagit-label.
adds 'edited' class to parent 'tagit-choice'
selects tag label text in added input by call to .select()
'blur' call of that added input:
uses only first available value - line is splitted with _splitAt and first value is used
if value is identical to old tag label - editing finished, nothing changed, all inputs and classes removed
otherwise tries to add a new tag with _addTag. If fails (eg. tag with same value already exists) - stays at edit state
if _addTag succeeds:
new tag is added at the end of tagsArray
removes old tag with _popTag and removes corresponding DOM element
moves last added tag to the place where old tag was with 'insertBefore' and _moveTag
fires 'tagsChanged' if it's present
finished editing process by removing inputs and classes like 'edited' and 'hidden'
Anyway, all this is in code, some comments were also added.
With lots of css changes for tagit in my project I wasn't able to add sample styles for: 'tagit-edit', 'hidden', 'edited', 'tagit-label'
I hope you will figure our yourself how to style these parts.
Changes were also added to tagit-themeroller, although weren't tested, so be careful when using.
Details:
small fixes:
features:
Edit logic: if 'editable=true' click on a tag:
Anyway, all this is in code, some comments were also added. With lots of css changes for tagit in my project I wasn't able to add sample styles for: 'tagit-edit', 'hidden', 'edited', 'tagit-label' I hope you will figure our yourself how to style these parts.
Changes were also added to tagit-themeroller, although weren't tested, so be careful when using.