diff options
author | Thomas Citharel <tcit@tcit.fr> | 2015-03-08 02:36:37 +0100 |
---|---|---|
committer | Thomas Citharel <tcit@tcit.fr> | 2015-03-08 02:36:37 +0100 |
commit | 512ff18015919bf3119509d1a8b8cf87b3b86f5f (patch) | |
tree | 84e4870a04e121fb909b4f308aeb6bc31d3f0c37 /themes/_global | |
parent | 5e10eee8fc2ccc05f511180a8c92f82de6d293b0 (diff) | |
download | wallabag-512ff18015919bf3119509d1a8b8cf87b3b86f5f.tar.gz wallabag-512ff18015919bf3119509d1a8b8cf87b3b86f5f.tar.zst wallabag-512ff18015919bf3119509d1a8b8cf87b3b86f5f.zip |
implement #11221.9.1alpha1
Diffstat (limited to 'themes/_global')
-rwxr-xr-x | themes/_global/js/autoCompleteTags.js | 14 |
1 files changed, 14 insertions, 0 deletions
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($) { | |||
43 | } | 43 | } |
44 | }); | 44 | }); |
45 | 45 | ||
46 | $('.suggestedtag').click(function(){ | ||
47 | var input = $("#value"); | ||
48 | var value = input.val(); | ||
49 | var tag = $(this).text(); | ||
50 | var terms = value.split(','); // tags into the <input> | ||
51 | if (jQuery.inArray(tag, terms) == -1 ) { // if the tag hasn't already been added | ||
52 | value += tag + ","; | ||
53 | input.val(value); | ||
54 | } | ||
55 | input.focus(); | ||
56 | input[0].selectionStart = input[0].selectionEnd = input.val().length; | ||
57 | |||
58 | }); | ||
59 | |||
46 | 60 | ||
47 | }); | 61 | }); |