mirror of
https://github.com/zulip/zulip.git
synced 2025-11-10 00:46:03 +00:00
compose_actions: Add hooks for compose.js modules.
This commit cuts the dependency on `compose.js` module for `compose_actions.js` module by introducing a hook system for registering different hooks from external modules.
This commit is contained in:
@@ -417,7 +417,19 @@ export function render_and_show_preview($preview_spinner, $preview_content_box,
|
||||
}
|
||||
}
|
||||
|
||||
function setup_compose_actions_hooks() {
|
||||
compose_actions.register_compose_box_clear_hook(clear_invites);
|
||||
compose_actions.register_compose_box_clear_hook(clear_private_stream_alert);
|
||||
compose_actions.register_compose_box_clear_hook(clear_preview_area);
|
||||
|
||||
compose_actions.register_compose_cancel_hook(abort_xhr);
|
||||
compose_actions.register_compose_cancel_hook(abort_video_callbacks);
|
||||
}
|
||||
|
||||
export function initialize() {
|
||||
// Register hooks for compose_actions.
|
||||
setup_compose_actions_hooks();
|
||||
|
||||
$("#below-compose-content .video_link").toggle(compute_show_video_chat_button());
|
||||
|
||||
$("#compose-textarea").on("keydown", (event) => {
|
||||
|
||||
Reference in New Issue
Block a user