Fix bug : now, when you delete the last character of a new tag, the previous tag is not removed.

This commit is contained in:
Maxime Corson
2011-06-07 02:51:19 -07:00
parent 240f4274a0
commit 7d9854a3bb
+2 -1
View File
@@ -222,10 +222,11 @@
}
});
//Delete last tag on backspace
data.removeWithBackspace && $(data.fake_input).bind('keyup', function(event)
data.removeWithBackspace && $(data.fake_input).bind('keydown', function(event)
{
if(event.keyCode == 8 && $(this).val() == '')
{
event.preventDefault();
var last_tag = $(this).closest('.tagsinput').find('.tag:last').text();
var id = $(this).attr('id').replace(/_tag$/, '');
last_tag = last_tag.replace(/[\s]+x$/, '');