mirror of
https://github.com/zulip/zulip.git
synced 2025-11-16 20:02:15 +00:00
compose: Improve tooltip on compose box "x" button.
In compose box, the "x" button tooltip text changed to "Cancel compose and save draft" except when unsent message length is short(<3). Also in help(?) > keyboard shortcuts, text for `Esc` changed to "Cancel compose and save draft". The help center page updated with the above changes. Fixes #21599.
This commit is contained in:
@@ -412,7 +412,14 @@ export function initialize() {
|
||||
|
||||
$("#compose-textarea").on("input propertychange", () => {
|
||||
compose_validate.warn_if_topic_resolved(false);
|
||||
compose_validate.check_overflow_text();
|
||||
const compose_text_length = compose_validate.check_overflow_text();
|
||||
// Change compose close button tooltip as per condition.
|
||||
// We save compose text in draft only if its length is > 2.
|
||||
if (compose_text_length > 2) {
|
||||
$("#compose_close").attr("data-tooltip-template-id", "compose_close_and_save_tooltip");
|
||||
} else {
|
||||
$("#compose_close").attr("data-tooltip-template-id", "compose_close_tooltip");
|
||||
}
|
||||
});
|
||||
|
||||
$("#compose form").on("submit", (e) => {
|
||||
|
||||
Reference in New Issue
Block a user