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.

compose_tooltips: Fix overlapping tooltips.

ubaidrmn714def080fb3
diff --git a/web/src/compose_tooltips.ts b/web/src/compose_tooltips.ts
index 2f9aeedb939..24d5fe2407e 100644
--- a/web/src/compose_tooltips.ts
+++ b/web/src/compose_tooltips.ts
@@ -218,13 +218,17 @@ export function initialize(): void {
appendTo: () => document.body,
onShow(instance) {
// Don't show send-area tooltips if the popover is displayed or if the send button is disabled.
- if (
- popover_menus.is_scheduled_messages_popover_displayed() ||
- $(".message-send-controls").hasClass("disabled-message-send-controls")
- ) {
+ if (popover_menus.is_scheduled_messages_popover_displayed()) {
return false;
}
- if (user_settings.enter_sends) {
+
+ if ($(".message-send-controls").hasClass("disabled-message-send-controls")) {
+ instance.setContent(
+ compose_recipient.get_posting_policy_error_message() ||
+ compose_validate.get_disabled_send_tooltip(),
+ );
+ return undefined;
+ } else if (user_settings.enter_sends) {
instance.setContent(parse_html($("#send-enter-tooltip-template").html()));
} else {
instance.setContent(parse_html($("#send-ctrl-enter-tooltip-template").html()));
@@ -270,27 +274,6 @@ export function initialize(): void {
instance.destroy();
},
});
-
- tippy.delegate("body", {
- // TODO: Might need to target just the Send button itself
- // in the new design
- target: ".disabled-message-send-controls",
- // 350px at 14px/1em
- maxWidth: "25em",
- onTrigger(instance) {
- instance.setContent(
- compose_recipient.get_posting_policy_error_message() ||
- compose_validate.get_disabled_send_tooltip(),
- );
- },
- content: () =>
- compose_recipient.get_posting_policy_error_message() ||
- compose_validate.get_disabled_send_tooltip(),
- appendTo: () => document.body,
- onHidden(instance) {
- instance.destroy();
- },
- });
}
export function hide_compose_control_button_tooltips($row: JQuery): void {