From 0d2b8030e1b89bf0aee684be3c5b74a6b47f00a7 Mon Sep 17 00:00:00 2001 From: Toks Date: Wed, 19 Jun 2013 13:50:33 -0400 Subject: [PATCH] fixes #1772 --- app/assets/javascripts/posts.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/assets/javascripts/posts.js b/app/assets/javascripts/posts.js index f2657d243..60971d9ab 100644 --- a/app/assets/javascripts/posts.js +++ b/app/assets/javascripts/posts.js @@ -42,10 +42,7 @@ return false; }, select: function(event, ui) { - var terms = this.value.match(/\S+/g); - terms.pop(); - terms.push(ui.item.value); - this.value = terms.join(" ") + " "; + this.value = this.value.replace(/\S+\s*$/g, ui.item.value + " "); return false; }, source: function(req, resp) {