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>
This commit is contained in:
Daniel Calviño Sánchez 2017-11-27 00:10:53 +01:00
parent 8eb19a278c
commit ea4414f9bc
2 changed files with 9 additions and 4 deletions

View File

@ -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;

View File

@ -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>';