diff options
author | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2017-11-27 00:10:53 +0100 |
---|---|---|
committer | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2017-11-27 00:10:53 +0100 |
commit | ea4414f9bc878385b9b17e702d0875c666ba06b6 (patch) | |
tree | 956a920ad2b7a7edd87cff4d0ab645acfa44a586 /apps/comments | |
parent | 8eb19a278c1667b4c8679076b21c1e5e08a77e9d (diff) | |
download | nextcloud-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')
-rw-r--r-- | apps/comments/css/comments.css | 4 | ||||
-rw-r--r-- | apps/comments/js/commentstabview.js | 9 |
2 files changed, 9 insertions, 4 deletions
diff --git a/apps/comments/css/comments.css b/apps/comments/css/comments.css index 16855749268..4ca415c3b02 100644 --- a/apps/comments/css/comments.css +++ b/apps/comments/css/comments.css @@ -127,8 +127,8 @@ position: relative; } -#commentsTabView .comment:not(.newCommentRow) .message .avatar-name-wrapper, -#commentsTabView .comment:not(.newCommentRow) .message .avatar-name-wrapper .avatar, +#commentsTabView .comment:not(.newCommentRow) .message .avatar-name-wrapper:not(.currentUser), +#commentsTabView .comment:not(.newCommentRow) .message .avatar-name-wrapper:not(.currentUser) .avatar, #commentsTabView .comment .authorRow .avatar:not(.currentUser), #commentsTabView .comment .authorRow .author:not(.currentUser) { cursor: pointer; 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>'; |