diff -r 96934a33d948 trunk/sites/all/modules/tagtool/tagtool.js --- a/trunk/sites/all/modules/tagtool/tagtool.js Sun Apr 11 09:59:14 2010 +0300 +++ b/trunk/sites/all/modules/tagtool/tagtool.js Sun Apr 11 10:30:05 2010 +0300 @@ -37,14 +37,17 @@ if (Drupal.jsEnabled) { .addClass('tag-item') .mouseover(function () { $(this).addClass('hover');}) .mouseout(function () { $(this).removeClass('hover'); }); $(this.popup).append(div); } $(this.popup).fadeIn('fast'); $('.tag-item').click(function () { var now_value = $(auto_input).val(); + var trimmed = $.trim(now_value); + if (trimmed.length > 0 && trimmed.lastIndexOf(",") != trimmed.length - 1) + now_value += ', '; $(auto_input).val(now_value + $(this).html() + ', '); }); }); }); }