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: Add utility function to clear all compose banners.

N-Shar-maff8d209807bd
diff --git a/web/src/compose_banner.ts b/web/src/compose_banner.ts
index f28ee239e75..8ab8e643ec0 100644
--- a/web/src/compose_banner.ts
+++ b/web/src/compose_banner.ts
@@ -65,6 +65,10 @@ export function clear_warnings(): void {
$(`#compose_banners .${CSS.escape(WARNING)}`).remove();
}
+export function clear_all(): void {
+ $(`#compose_banners`).empty();
+}
+
export function show_error_message(message: string, classname: string, $bad_input?: JQuery): void {
$(`#compose_banners .${CSS.escape(classname)}`).remove();
diff --git a/web/src/hotkey.js b/web/src/hotkey.js
index 759f12538b0..194ec50449e 100644
--- a/web/src/hotkey.js
+++ b/web/src/hotkey.js
@@ -310,9 +310,7 @@ export function process_escape_key(e) {
// Check for errors in compose box; close errors if they exist
if ($(".compose_banner").length) {
- compose_banner.clear_message_sent_banners();
- compose_banner.clear_errors();
- compose_banner.clear_warnings();
+ compose_banner.clear_all();
return true;
}