mirror of
https://github.com/nextcloud/server.git
synced 2026-02-11 14:54:02 -05:00
add contactsmenu popover to comments
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
This commit is contained in:
parent
e61cf83faf
commit
897bd5cfef
2 changed files with 24 additions and 2 deletions
|
|
@ -54,7 +54,6 @@
|
|||
|
||||
#commentsTabView .comment {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
|
|
@ -108,6 +107,11 @@
|
|||
vertical-align: middle;
|
||||
}
|
||||
|
||||
#commentsTabView .authorRow>div.hidden {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
#commentsTabView .comments li .message .avatar-name-wrapper,
|
||||
#commentsTabView .comment .authorRow {
|
||||
position: relative;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -232,6 +232,21 @@
|
|||
var $this = $(this);
|
||||
$this.avatar($this.attr('data-username'), 32);
|
||||
});
|
||||
|
||||
var username = $el.find('.avatar').data('username');
|
||||
if (username !== oc_current_user) {
|
||||
$el.find('.authorRow .avatar, .authorRow .author').contactsMenu(
|
||||
username, 0, $el.find('.authorRow'));
|
||||
}
|
||||
|
||||
var message = $el.find('.message');
|
||||
message.find('.avatar').each(function() {
|
||||
var avatar = $(this);
|
||||
var strong = $(this).next();
|
||||
var appendTo = $(this).parent();
|
||||
|
||||
$.merge(avatar, strong).contactsMenu(avatar.data('user'), 0, appendTo);
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
@ -251,7 +266,10 @@
|
|||
|
||||
// escape possible regex characters in the name
|
||||
mention = mention.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
||||
var displayName = avatar + ' <strong>'+ _.escape(mentions[i].mentionDisplayName)+'</strong>';
|
||||
var displayName = ''
|
||||
+ '<span class="avatar-name-wrapper">'
|
||||
+ avatar + ' <strong>'+ _.escape(mentions[i].mentionDisplayName)+'</strong>'
|
||||
+ '</span>';
|
||||
|
||||
// replace every mention either at the start of the input or after a whitespace
|
||||
// followed by a non-word character.
|
||||
|
|
|
|||
Loading…
Reference in a new issue