From 512ff18015919bf3119509d1a8b8cf87b3b86f5f Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Sun, 8 Mar 2015 02:36:37 +0100 Subject: implement #1122 --- themes/_global/js/autoCompleteTags.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'themes/_global/js') diff --git a/themes/_global/js/autoCompleteTags.js b/themes/_global/js/autoCompleteTags.js index 90bc982c..986e71d1 100755 --- a/themes/_global/js/autoCompleteTags.js +++ b/themes/_global/js/autoCompleteTags.js @@ -43,5 +43,19 @@ jQuery(function($) { } }); + $('.suggestedtag').click(function(){ + var input = $("#value"); + var value = input.val(); + var tag = $(this).text(); + var terms = value.split(','); // tags into the + if (jQuery.inArray(tag, terms) == -1 ) { // if the tag hasn't already been added + value += tag + ","; + input.val(value); + } + input.focus(); + input[0].selectionStart = input[0].selectionEnd = input.val().length; + + }); + }); -- cgit v1.2.3