summaryrefslogtreecommitdiffstats
path: root/apps/comments
diff options
context:
space:
mode:
authorGeorg Ehrke <developer@georgehrke.com>2017-04-24 19:52:45 +0200
committerGeorg Ehrke <developer@georgehrke.com>2017-04-26 09:28:14 +0200
commit897bd5cfefde22b4bdfc6d9dd67aa3bd865af306 (patch)
tree7a4e15ae63ef511c1eaddd8ebecc4af59f9fed8a /apps/comments
parente61cf83faf5cda15ba9f27193b7c5a89c9129da9 (diff)
downloadnextcloud-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')
-rw-r--r--apps/comments/css/comments.css6
-rw-r--r--apps/comments/js/commentstabview.js20
2 files changed, 24 insertions, 2 deletions
diff --git a/apps/comments/css/comments.css b/apps/comments/css/comments.css
index 796a550227b..2d794d52708 100644
--- a/apps/comments/css/comments.css
+++ b/apps/comments/css/comments.css
@@ -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;
}
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.