setup atwho autocomplete

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
This commit is contained in:
Arthur Schiwon 2017-10-17 13:22:57 +02:00
parent 8e60a2bd28
commit d1afbedc5f
No known key found for this signature in database
GPG Key ID: 7424F1874854DF23
1 changed files with 23 additions and 0 deletions

View File

@ -140,6 +140,29 @@
setFileInfo: function(fileInfo) {
if (fileInfo) {
this.model = fileInfo;
var s = this;
_.defer(function () {
$.get(
OC.generateUrl('/autocomplete/get'),
{
itemType: 'files',
itemId: fileInfo.get('id'),
sorter: 'comments|share-recipients'
},
function (data) {
console.warn(data);
$('textarea.message').atwho({
at: '@',
data: data,
displayTpl: "<li>${label}</li>",
insertTpl: "${atwho-at}${label}",
searchKey: "label"
});
}
)
});
this.render();
this.collection.setObjectId(fileInfo.id);
// reset to first page