From 185433967e6680d7d5f8138b5241314c879042ac Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Tue, 18 Oct 2016 17:23:52 +0200 Subject: [PATCH] display avatar (if enabled) alongside displaynames Signed-off-by: Arthur Schiwon --- apps/comments/css/comments.css | 4 ++++ apps/comments/js/commentstabview.js | 9 ++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/apps/comments/css/comments.css b/apps/comments/css/comments.css index 667f32871b..796a550227 100644 --- a/apps/comments/css/comments.css +++ b/apps/comments/css/comments.css @@ -64,6 +64,10 @@ line-height: 32px; } +#commentsTabView .comment .message .avatar { + display: inline-block; +} + #activityTabView li.comment.collapsed .activitymessage, #commentsTabView .comment.collapsed .message { white-space: pre-wrap; diff --git a/apps/comments/js/commentstabview.js b/apps/comments/js/commentstabview.js index e8bd4f82e9..c4b2bd61d4 100644 --- a/apps/comments/js/commentstabview.js +++ b/apps/comments/js/commentstabview.js @@ -257,10 +257,17 @@ for(var i in mentions) { var mention = '@' + mentions[i].mentionId; + var avatar = ''; + if(this._avatarsEnabled) { + avatar = '
'; + } // escape possible regex characters in the name mention = mention.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); - var displayName = ''+ _.escape(mentions[i].mentionDisplayName)+''; + var displayName = avatar + ' '+ _.escape(mentions[i].mentionDisplayName)+''; // replace every mention either at the start of the input or after a whitespace // followed by a non-word character.