summaryrefslogtreecommitdiffstats
path: root/apps/comments/js
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2018-09-15 18:42:52 +0200
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2018-09-15 18:42:52 +0200
commit527d237289f19ffe0616f4061b9067ce415865df (patch)
tree075af169ce7dfbe80ca7e0027634370b1fae0cd9 /apps/comments/js
parent6112adfe064afbad17c485954d22e3947fe8ed13 (diff)
downloadnextcloud-server-527d237289f19ffe0616f4061b9067ce415865df.tar.gz
nextcloud-server-527d237289f19ffe0616f4061b9067ce415865df.zip
Fix contacts menu not triggered on certain areas of a mention
The contacts menu was triggered only when the avatar or the name of the user were clicked. Due to this, clicking on certain (small) areas of a mention (like the right end, or the space between the avatar and the name) did not show the contacts menu. Now the contacts menu is shown when any area of the mention is clicked. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'apps/comments/js')
-rw-r--r--apps/comments/js/commentstabview.js15
1 files changed, 7 insertions, 8 deletions
diff --git a/apps/comments/js/commentstabview.js b/apps/comments/js/commentstabview.js
index 3c428fe86a6..28382c8b67e 100644
--- a/apps/comments/js/commentstabview.js
+++ b/apps/comments/js/commentstabview.js
@@ -442,14 +442,13 @@
return;
}
- $el.find('.avatar').each(function() {
- var avatar = $(this);
- var strong = $(this).next();
- var appendTo = $(this).parent();
-
- var username = $(this).data('username');
- if (username !== oc_current_user) {
- $.merge(avatar, strong).contactsMenu(avatar.data('user'), 0, appendTo);
+ $el.find('.avatar-name-wrapper').each(function() {
+ var $this = $(this);
+ var $avatar = $this.find('.avatar');
+
+ var user = $avatar.data('user');
+ if (user !== OC.getCurrentUser().uid) {
+ $this.contactsMenu(user, 0, $this);
}
});
},