mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 22:43:42 +00:00
compose: Move to hbs file and append it to DOM on init.
We move compose.html to compose.hbs file while keeping `#compose` still in `home.html` as a hanger where append rest of the elements. This will provide us with two benefits: * We could share common elements between message_edit_form and compose. * We can insert compose directly in any element. We may decide to do it for recent topics.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import $ from "jquery";
|
||||
import _ from "lodash";
|
||||
|
||||
import render_compose from "../templates/compose.hbs";
|
||||
import render_compose_all_everyone from "../templates/compose_all_everyone.hbs";
|
||||
import render_compose_announce from "../templates/compose_announce.hbs";
|
||||
import render_compose_invite_users from "../templates/compose_invite_users.hbs";
|
||||
@@ -1098,6 +1099,15 @@ export function warn_if_mentioning_unsubscribed_user(mentioned) {
|
||||
}
|
||||
|
||||
export function initialize() {
|
||||
const $compose = $("#compose");
|
||||
$compose.append(
|
||||
render_compose({
|
||||
embedded: $compose.attr("data-embedded") === "",
|
||||
file_upload_enabled: page_params.max_file_upload_size_mib > 0,
|
||||
giphy_api_available: page_params.giphy_api_key !== "",
|
||||
}),
|
||||
);
|
||||
|
||||
$("#below-compose-content .video_link").toggle(compute_show_video_chat_button());
|
||||
$(
|
||||
"#stream_message_recipient_stream,#stream_message_recipient_topic,#private_message_recipient",
|
||||
|
||||
Reference in New Issue
Block a user