diff options
author | Georg Ehrke <developer@georgehrke.com> | 2017-04-24 19:52:45 +0200 |
---|---|---|
committer | Georg Ehrke <developer@georgehrke.com> | 2017-04-26 09:28:14 +0200 |
commit | 897bd5cfefde22b4bdfc6d9dd67aa3bd865af306 (patch) | |
tree | 7a4e15ae63ef511c1eaddd8ebecc4af59f9fed8a /apps/comments/js/commentstabview.js | |
parent | e61cf83faf5cda15ba9f27193b7c5a89c9129da9 (diff) | |
download | nextcloud-server-897bd5cfefde22b4bdfc6d9dd67aa3bd865af306.tar.gz nextcloud-server-897bd5cfefde22b4bdfc6d9dd67aa3bd865af306.zip |
add contactsmenu popover to comments
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
Diffstat (limited to 'apps/comments/js/commentstabview.js')
-rw-r--r-- | apps/comments/js/commentstabview.js | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/apps/comments/js/commentstabview.js b/apps/comments/js/commentstabview.js index 2256bea943e..ace0862ad2e 100644 --- a/apps/comments/js/commentstabview.js +++ b/apps/comments/js/commentstabview.js @@ -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. |