mirror of
https://github.com/zulip/zulip.git
synced 2025-11-12 01:47:41 +00:00
compose_tooltip: Remove delay for invalid messages.
Does what714def080fwas trying to do without the side effects. Fixes:714def080f
This commit is contained in:
committed by
Tim Abbott
parent
58f16468ca
commit
54fd02b173
@@ -209,7 +209,7 @@ export function initialize(): void {
|
||||
});
|
||||
|
||||
tippy.delegate("body", {
|
||||
target: "#compose-send-button",
|
||||
target: "#compose-send-button:not(.disabled-message-send-controls)",
|
||||
delay: EXTRA_LONG_HOVER_DELAY,
|
||||
// By default, tippyjs uses a trigger value of "mouseenter focus",
|
||||
// but by specifying "mouseenter", this will prevent showing the
|
||||
@@ -217,18 +217,11 @@ export function initialize(): void {
|
||||
trigger: "mouseenter",
|
||||
appendTo: () => document.body,
|
||||
onShow(instance) {
|
||||
// Don't show send-area tooltips if the popover is displayed or if the send button is disabled.
|
||||
// Don't show send-area tooltips if the popover is displayed.
|
||||
if (popover_menus.is_scheduled_messages_popover_displayed()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
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) {
|
||||
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()));
|
||||
@@ -237,6 +230,22 @@ export function initialize(): void {
|
||||
},
|
||||
});
|
||||
|
||||
tippy.delegate("body", {
|
||||
target: "#compose-send-button.disabled-message-send-controls",
|
||||
// 350px at 14px/1em
|
||||
maxWidth: "25em",
|
||||
onShow(instance) {
|
||||
instance.setContent(
|
||||
compose_recipient.get_posting_policy_error_message() ||
|
||||
compose_validate.get_disabled_send_tooltip(),
|
||||
);
|
||||
},
|
||||
appendTo: () => document.body,
|
||||
onHidden(instance) {
|
||||
instance.destroy();
|
||||
},
|
||||
});
|
||||
|
||||
tippy.delegate("body", {
|
||||
target: ".narrow_to_compose_recipients",
|
||||
delay: LONG_HOVER_DELAY,
|
||||
|
||||
Reference in New Issue
Block a user