compose: Add a helper function to find the banner container.

This commit is contained in:
Daniil Fadeev 2023-05-02 16:03:49 +07:00 committed by Tim Abbott
parent 3b35307c20
commit 394b3586b9
1 changed files with 6 additions and 0 deletions

View File

@ -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.