mirror of
https://github.com/wallabag/wallabag.git
synced 2025-09-15 18:57:05 +00:00
implement #1122
This commit is contained in:
parent
5e10eee8fc
commit
512ff18015
3 changed files with 19 additions and 1 deletions
|
@ -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;
|
||||
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue