add contactsmenu popover to comments

Signed-off-by: Georg Ehrke <developer@georgehrke.com>
pull/4374/head
Georg Ehrke 8 years ago
parent e61cf83faf
commit 897bd5cfef
No known key found for this signature in database
GPG Key ID: 9D98FD9380A1CB43
  1. 6
      apps/comments/css/comments.css
  2. 20
      apps/comments/js/commentstabview.js

@ -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…
Cancel
Save