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 ++++++++++++++ themes/baggy/edit-tags.twig | 4 +++- 2 files changed, 17 insertions(+), 1 deletion(-) (limited to 'themes') 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; + + }); + }); diff --git a/themes/baggy/edit-tags.twig b/themes/baggy/edit-tags.twig index 15f15560..ae6684f2 100755 --- a/themes/baggy/edit-tags.twig +++ b/themes/baggy/edit-tags.twig @@ -16,7 +16,7 @@
{% trans "no tags" %}
{% endif %}
@@ -25,5 +25,7 @@

{% trans "Start typing for auto complete." %}
{% trans "You can enter multiple tags, separated by commas." %}

+All existing tags : + {% trans "return to article" %} {% endblock %} -- cgit v1.2.3