summaryrefslogtreecommitdiffstats
path: root/apps/comments/js
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2017-11-27 00:10:53 +0100
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2017-11-27 00:10:53 +0100
commitea4414f9bc878385b9b17e702d0875c666ba06b6 (patch)
tree956a920ad2b7a7edd87cff4d0ab645acfa44a586 /apps/comments/js
parent8eb19a278c1667b4c8679076b21c1e5e08a77e9d (diff)
downloadnextcloud-server-ea4414f9bc878385b9b17e702d0875c666ba06b6.tar.gz
nextcloud-server-ea4414f9bc878385b9b17e702d0875c666ba06b6.zip
Disable contacts menu for mentions to current user in comment messages
The contacts menu is not shown for avatars and user names in the author row if they represent the current user. For consistency, and because the contacts menu provides no value when shown for the current user, this commit also disables the contacts menu for mentions to the current user. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'apps/comments/js')
-rw-r--r--apps/comments/js/commentstabview.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/apps/comments/js/commentstabview.js b/apps/comments/js/commentstabview.js
index 867072c4665..67e2a37a40b 100644
--- a/apps/comments/js/commentstabview.js
+++ b/apps/comments/js/commentstabview.js
@@ -410,7 +410,10 @@
var strong = $(this).next();
var appendTo = $(this).parent();
- $.merge(avatar, strong).contactsMenu(avatar.data('user'), 0, appendTo);
+ var username = $(this).data('username');
+ if (username !== oc_current_user) {
+ $.merge(avatar, strong).contactsMenu(avatar.data('user'), 0, appendTo);
+ }
});
},
@@ -451,9 +454,11 @@
+ ' data-user-display-name="'
+ _.escape(displayName) + '"></div>';
+ var isCurrentUser = (uid === oc_current_user);
+
return ''
+ '<span class="atwho-inserted" contenteditable="false">'
- + '<span class="avatar-name-wrapper">'
+ + '<span class="avatar-name-wrapper' + (isCurrentUser ? ' currentUser' : '') + '">'
+ avatar + ' <strong>'+ _.escape(displayName)+'</strong>'
+ '</span>'
+ '</span>';