tippy: Fix compose close button tooltip when no input.

The tooltip of the compose_close_button changes only when something
is typed into the input box. However, the state of the tooltip
remains the same until someone types into the input box again, even
if they close and reopen the compose box.

The function 'expand_compose_box' from 'compose_actions.js' is
called every time the compose box is opened. Since the input field
is emptied every time the compose box is closed, this function is
used to set the default tooltip for the close button. We want it to
say 'Cancel Compose' every time the compose box is opened since the
input field is always going to be empty whenever the compose box
reopens.
This commit is contained in:
palashb01
2023-04-03 02:50:18 +05:30
committed by Tim Abbott
parent 9809d229de
commit 84b4f498d5

View File

@@ -133,6 +133,7 @@ export function autosize_message_content() {
}
export function expand_compose_box() {
$("#compose_close").attr("data-tooltip-template-id", "compose_close_tooltip_template");
$("#compose_close").show();
$("#compose_controls").hide();
$(".message_comp").show();