Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

reaction_button: Use tippy for tooltip.

Aman Agrawal487fcb6a3cb1
diff --git a/static/js/emoji_picker.js b/static/js/emoji_picker.js
index 467fdf92938..a9be3e4046a 100644
--- a/static/js/emoji_picker.js
+++ b/static/js/emoji_picker.js
@@ -721,26 +721,6 @@ export function register_click_handlers() {
toggle_emoji_popover(this, message_id);
});
- $("#main_div").on("mouseenter", ".reaction_button", (e) => {
- e.stopPropagation();
-
- const elem = $(e.currentTarget);
- const title = i18n.t("Add emoji reaction");
- elem.tooltip({
- title: title + " (:)",
- trigger: "hover",
- placement: "bottom",
- animation: false,
- });
- elem.tooltip("show");
- $(".tooltip-arrow").remove();
- });
-
- $("#main_div").on("mouseleave", ".reaction_button", (e) => {
- e.stopPropagation();
- $(e.currentTarget).tooltip("hide");
- });
-
$("body").on("click", ".actions_popover .reaction_button", (e) => {
const message_id = $(e.currentTarget).data("message-id");
e.preventDefault();
diff --git a/static/templates/message_controls.hbs b/static/templates/message_controls.hbs
index b69abc996f9..2b60479c05d 100644
--- a/static/templates/message_controls.hbs
+++ b/static/templates/message_controls.hbs
@@ -4,7 +4,7 @@
{{/if}}
{{#unless msg/sent_by_me}}
- <div class="reaction_button">
+ <div class="reaction_button tippy-zulip-tooltip" data-tippy-content="{{t 'Add emoji reaction' }}">
<i class="fa fa-smile-o" aria-label="{{#tr this}}Add emoji reaction{{/tr}} (:)" role="button" aria-haspopup="true" tabindex="0"></i>
</div>
{{/unless}}
diff --git a/static/templates/message_reactions.hbs b/static/templates/message_reactions.hbs
index 995516fd800..cc9c2aed74d 100644
--- a/static/templates/message_reactions.hbs
+++ b/static/templates/message_reactions.hbs
@@ -1,7 +1,7 @@
{{#each this/msg/message_reactions}}
{{> message_reaction}}
{{/each}}
-<div class="reaction_button" aria-label="{{t 'Add emoji reaction' }} (:)">
+<div class="reaction_button tippy-zulip-tooltip" data-tippy-content="{{t 'Add emoji reaction' }}" aria-label="{{t 'Add emoji reaction' }} (:)">
<i class="fa fa-smile-o" role="button" aria-haspopup="true" tabindex="0" aria-label="{{t 'Add emoji reaction' }} (:)"></i>
<div class="message_reaction_count">+</div>
</div>