summaryrefslogtreecommitdiffstats
path: root/apps/comments/js
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2017-10-17 13:22:57 +0200
committerArthur Schiwon <blizzz@arthur-schiwon.de>2017-10-22 14:14:33 +0200
commitd1afbedc5fa34653e3019ab254d4ed7a8d046617 (patch)
treeffe5ed5037be32e8b5248ee4b3f56042ddcf295b /apps/comments/js
parent8e60a2bd28fe7ae61faa8c4c019d97c673ab2bb9 (diff)
downloadnextcloud-server-d1afbedc5fa34653e3019ab254d4ed7a8d046617.tar.gz
nextcloud-server-d1afbedc5fa34653e3019ab254d4ed7a8d046617.zip
setup atwho autocomplete
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'apps/comments/js')
-rw-r--r--apps/comments/js/commentstabview.js23
1 files changed, 23 insertions, 0 deletions
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: "<li>${label}</li>",
+ insertTpl: "${atwho-at}${label}",
+ searchKey: "label"
+ });
+ }
+ )
+ });
+
this.render();
this.collection.setObjectId(fileInfo.id);
// reset to first page