compose: Extract compose.toggle_entry_sends_ui function.

This commit extracts the code for hiding and showing the
send button according to 'enter_sends' setting value in
a separate function.
This commit is contained in:
Sahil Batra
2021-07-27 13:12:31 +05:30
committed by Tim Abbott
parent 7af789c48f
commit dafd32bd09
3 changed files with 11 additions and 8 deletions

View File

@@ -124,6 +124,15 @@ export function empty_topic_placeholder() {
return $t({defaultMessage: "(no topic)"});
}
export function toggle_enter_sends_ui() {
const send_button = $("#compose-send-button");
if (page_params.enter_sends) {
send_button.fadeOut();
} else {
send_button.fadeIn();
}
}
export function create_message_object() {
// Topics are optional, and we provide a placeholder if one isn't given.
let topic = compose_state.topic();