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 a helper function to find the banner container.

Daniil Fadeev394b3586b9fb
diff --git a/web/src/compose_banner.ts b/web/src/compose_banner.ts
index 99b1c14d649..652f4abeaf2 100644
--- a/web/src/compose_banner.ts
+++ b/web/src/compose_banner.ts
@@ -51,6 +51,12 @@ export const CLASSNAMES = {
user_not_subscribed: "user_not_subscribed",
};
+export function get_compose_banner_container($textarea: JQuery): JQuery {
+ return $textarea.attr("id") === "compose-textarea"
+ ? $("#compose_banners")
+ : $textarea.closest(".message_edit_form").find(".edit_form_banners");
+}
+
// This function provides a convenient way to add new elements
// to a banner container. The function accepts a container element
// as a parameter, to which a banner should be appended.