diff options
author | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2018-09-15 18:42:52 +0200 |
---|---|---|
committer | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2018-09-15 18:42:52 +0200 |
commit | 527d237289f19ffe0616f4061b9067ce415865df (patch) | |
tree | 075af169ce7dfbe80ca7e0027634370b1fae0cd9 /apps/comments/js | |
parent | 6112adfe064afbad17c485954d22e3947fe8ed13 (diff) | |
download | nextcloud-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.js | 15 |
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); } }); }, |