From d1afbedc5fa34653e3019ab254d4ed7a8d046617 Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Tue, 17 Oct 2017 13:22:57 +0200 Subject: setup atwho autocomplete Signed-off-by: Arthur Schiwon --- apps/comments/js/commentstabview.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/apps/comments/js/commentstabview.js b/apps/comments/js/commentstabview.js index 3a20604326b..d379af36638 100644 --- a/apps/comments/js/commentstabview.js +++ b/apps/comments/js/commentstabview.js @@ -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: "
  • ${label}
  • ", + insertTpl: "${atwho-at}${label}", + searchKey: "label" + }); + } + ) + }); + this.render(); this.collection.setObjectId(fileInfo.id); // reset to first page -- cgit v1.2.3