summaryrefslogtreecommitdiffstats
path: root/apps/comments
diff options
context:
space:
mode:
Diffstat (limited to 'apps/comments')
-rw-r--r--apps/comments/css/comments.css4
-rw-r--r--apps/comments/js/commentstabview.js9
2 files changed, 12 insertions, 1 deletions
diff --git a/apps/comments/css/comments.css b/apps/comments/css/comments.css
index 667f32871bb..796a550227b 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 e8bd4f82e9b..c4b2bd61d4e 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 = '<div class="avatar" '
+ + 'data-user="' + _.escape(mentions[i].mentionId) + '"'
+ +' data-user-display-name="'
+ + _.escape(mentions[i].mentionDisplayName) + '"></div>';
+ }
// escape possible regex characters in the name
mention = mention.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
- var displayName = '<b>'+ _.escape(mentions[i].mentionDisplayName)+'</b>';
+ var displayName = avatar + ' <strong>'+ _.escape(mentions[i].mentionDisplayName)+'</strong>';
// replace every mention either at the start of the input or after a whitespace
// followed by a non-word character.