mirror of
https://github.com/zulip/zulip.git
synced 2025-11-13 10:26:28 +00:00
committed by
Tim Abbott
parent
8349437aff
commit
865f886f56
@@ -573,6 +573,27 @@ export function initialize() {
|
|||||||
get_target_node,
|
get_target_node,
|
||||||
check_reference_removed,
|
check_reference_removed,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/*
|
||||||
|
The following implements a little tooltip giving the name for status emoji
|
||||||
|
when hovering them in the right sidebar. This requires special logic, to avoid
|
||||||
|
conflicting with the main tooltip or showing duplicate tooltips.
|
||||||
|
*/
|
||||||
|
$(".user-presence-link .status-emoji-name").off("mouseenter").off("mouseleave");
|
||||||
|
$(".user-presence-link .status-emoji-name").on("mouseenter", () => {
|
||||||
|
const instance = $elem.parent()[0]._tippy;
|
||||||
|
if (instance && instance.state.isVisible) {
|
||||||
|
instance.destroy();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$(".user-presence-link .status-emoji-name").on("mouseleave", () => {
|
||||||
|
do_render_buddy_list_tooltip(
|
||||||
|
$elem.parent(),
|
||||||
|
title_data,
|
||||||
|
get_target_node,
|
||||||
|
check_reference_removed,
|
||||||
|
);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// DIRECT MESSAGE LIST TOOLTIPS (not displayed on touch devices)
|
// DIRECT MESSAGE LIST TOOLTIPS (not displayed on touch devices)
|
||||||
@@ -606,6 +627,27 @@ export function initialize() {
|
|||||||
check_reference_removed,
|
check_reference_removed,
|
||||||
check_subtree,
|
check_subtree,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/*
|
||||||
|
The following implements a little tooltip giving the name for status emoji
|
||||||
|
when hovering them in the left sidebar. This requires special logic, to avoid
|
||||||
|
conflicting with the main tooltip or showing duplicate tooltips.
|
||||||
|
*/
|
||||||
|
$(".dm-user-status .status-emoji-name").off("mouseenter").off("mouseleave");
|
||||||
|
$(".dm-user-status .status-emoji-name").on("mouseenter", () => {
|
||||||
|
const instance = $elem[0]._tippy;
|
||||||
|
if (instance && instance.state.isVisible) {
|
||||||
|
instance.destroy();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$(".dm-user-status .status-emoji-name").on("mouseleave", () => {
|
||||||
|
do_render_buddy_list_tooltip(
|
||||||
|
$elem,
|
||||||
|
title_data,
|
||||||
|
get_target_node,
|
||||||
|
check_reference_removed,
|
||||||
|
);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// Recent conversations direct messages (Not displayed on small widths)
|
// Recent conversations direct messages (Not displayed on small widths)
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import tippy, {delegate} from "tippy.js";
|
|||||||
import render_tooltip_templates from "../templates/tooltip_templates.hbs";
|
import render_tooltip_templates from "../templates/tooltip_templates.hbs";
|
||||||
|
|
||||||
import {$t} from "./i18n";
|
import {$t} from "./i18n";
|
||||||
|
import * as popovers from "./popovers";
|
||||||
import {user_settings} from "./user_settings";
|
import {user_settings} from "./user_settings";
|
||||||
|
|
||||||
// For tooltips without data-tippy-content, we use the HTML content of
|
// For tooltips without data-tippy-content, we use the HTML content of
|
||||||
@@ -506,6 +507,29 @@ export function initialize(): void {
|
|||||||
appendTo: () => document.body,
|
appendTo: () => document.body,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
delegate("body", {
|
||||||
|
target: ".status-emoji-name",
|
||||||
|
placement: "top",
|
||||||
|
delay: INSTANT_HOVER_DELAY,
|
||||||
|
appendTo: () => document.body,
|
||||||
|
|
||||||
|
/*
|
||||||
|
Status emoji tooltips for most locations in the app. This
|
||||||
|
basic tooltip logic is overridden by separate logic in
|
||||||
|
click_handlers.js for the left and right sidebars, to
|
||||||
|
avoid problematic interactions with the main tooltips for
|
||||||
|
those regions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
onShow() {
|
||||||
|
popovers.hide_all();
|
||||||
|
},
|
||||||
|
|
||||||
|
onHidden(instance) {
|
||||||
|
instance.destroy();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
delegate("body", {
|
delegate("body", {
|
||||||
/*
|
/*
|
||||||
The tooltip for new user group button (+) icon button on #groups
|
The tooltip for new user group button (+) icon button on #groups
|
||||||
|
|||||||
@@ -2,11 +2,11 @@
|
|||||||
{{#if emoji_alt_code}}
|
{{#if emoji_alt_code}}
|
||||||
<span class="emoji_alt_code"> :{{emoji_name}}:</span>
|
<span class="emoji_alt_code"> :{{emoji_name}}:</span>
|
||||||
{{else if still_url}}
|
{{else if still_url}}
|
||||||
<img src="{{still_url}}" class="emoji status-emoji" data-animated-url="{{url}}" data-still-url="{{still_url}}" />
|
<img src="{{still_url}}" class="emoji status-emoji status-emoji-name" data-animated-url="{{url}}" data-still-url="{{still_url}}" data-tippy-content=":{{emoji_name}}:" />
|
||||||
{{else if url}}
|
{{else if url}}
|
||||||
{{!-- note that we have no still_url --}}
|
{{!-- note that we have no still_url --}}
|
||||||
<img src="{{url}}" class="emoji status-emoji" data-animated-url="{{url}}" />
|
<img src="{{url}}" class="emoji status-emoji status-emoji-name" data-animated-url="{{url}}" data-tippy-content=":{{emoji_name}}:" />
|
||||||
{{else if emoji_code}}
|
{{else if emoji_name}}
|
||||||
<span class="emoji status-emoji emoji-{{emoji_code}}"></span>
|
<span class="emoji status-emoji status-emoji-name emoji-{{emoji_code}}" data-tippy-content=":{{emoji_name}}:"></span>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|||||||
Reference in New Issue
Block a user