1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-09-15 18:57:05 +00:00
This commit is contained in:
Thomas Citharel 2015-03-08 02:36:37 +01:00
parent 5e10eee8fc
commit 512ff18015
3 changed files with 19 additions and 1 deletions

View file

@ -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 <input>
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;
});
});