do_render_buddy_list_tooltip: Don't show tooltip on touch devices.

Read the comment for details.
This commit is contained in:
Aman Agrawal 2023-04-06 06:40:16 +00:00 committed by Tim Abbott
parent 13e0986091
commit a62fcb1fd9
1 changed files with 9 additions and 3 deletions

View File

@ -469,6 +469,7 @@ export function initialize() {
$(".tooltip").remove();
});
// Doesn't show tooltip on touch devices.
function do_render_buddy_list_tooltip(
$elem,
title_data,
@ -490,6 +491,11 @@ export function initialize() {
// so that they don't stick and overlap with
// each other.
delay: 0,
// Don't show tooltip on touch devices (99% mobile) since touch pressing on users in the left or right
// sidebar leads to narrow being changed and the sidebar is hidden. So, there is no user displayed
// to show tooltip for. It is safe to show the tooltip on long press but it not worth
// the inconvenience of having a tooltip hanging around on a small mobile screen if anything going wrong.
touch: false,
content: () => parse_html(render_buddy_list_tooltip_content(title_data)),
arrow: true,
placement,
@ -524,7 +530,7 @@ export function initialize() {
});
}
// BUDDY LIST TOOLTIPS
// BUDDY LIST TOOLTIPS (not displayed on touch devices)
$("#user_presences").on("mouseenter", ".selectable_sidebar_block", (e) => {
e.stopPropagation();
const $elem = $(e.currentTarget).closest(".user_sidebar_entry").find(".user-presence-link");
@ -551,7 +557,7 @@ export function initialize() {
);
});
// PM LIST TOOLTIPS
// PM LIST TOOLTIPS (not displayed on touch devices)
$("body").on("mouseenter", ".pm_user_status", (e) => {
e.stopPropagation();
const $elem = $(e.currentTarget);
@ -584,7 +590,7 @@ export function initialize() {
);
});
// Recent conversations PMs
// Recent conversations PMs (Not displayed on small widths)
$("body").on("mouseenter", ".recent_topic_stream .pm_status_icon", (e) => {
e.stopPropagation();
const $elem = $(e.currentTarget);