From d0c3b45f0f89462300d5170a6f7902387852294d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Calvi=C3=B1o=20S=C3=A1nchez?= Date: Sat, 15 Sep 2018 18:42:52 +0200 Subject: [PATCH 1/2] Fix contacts menu not triggered on certain areas of a mention MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- apps/comments/js/commentstabview.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/apps/comments/js/commentstabview.js b/apps/comments/js/commentstabview.js index 3c428fe86a..28382c8b67 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(); + $el.find('.avatar-name-wrapper').each(function() { + var $this = $(this); + var $avatar = $this.find('.avatar'); - var username = $(this).data('username'); - if (username !== oc_current_user) { - $.merge(avatar, strong).contactsMenu(avatar.data('user'), 0, appendTo); + var user = $avatar.data('user'); + if (user !== OC.getCurrentUser().uid) { + $this.contactsMenu(user, 0, $this); } }); }, From c2743441609afc825a1dad8f536bac7b90305f3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Calvi=C3=B1o=20S=C3=A1nchez?= Date: Sat, 15 Sep 2018 19:53:06 +0200 Subject: [PATCH 2/2] Fix position of contacts menu shown on mentions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There are no default CSS rules for the contacts menu, as its position depends on the element on which it is shown. Note, however, that if no explicit rules are provided the contacts menu on mentions is affected by the rules for the contacts menu on shares from the sharing tab. The contacts menu is now positioned to show the tip of the arrow horizontally aligned with the center of the avatar, and with the top of the menu slightly below the bottom border of the mention. Signed-off-by: Daniel Calviño Sánchez --- apps/comments/css/comments.scss | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/comments/css/comments.scss b/apps/comments/css/comments.scss index 84d328ca6f..e631d6891f 100644 --- a/apps/comments/css/comments.scss +++ b/apps/comments/css/comments.scss @@ -254,3 +254,8 @@ .app-files .action-comment { padding: 16px 14px; } + +#commentsTabView .comment .message .contactsmenu-popover { + left: -6px; + top: 24px; +}