mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 22:13:26 +00:00
compose: Fix behavior hitting enter with the preview area open.
The new behavior is: (1) If enter-sends is enabled, just send the messsage. (2) If enter-sends is not enabled, return focus to the compose area. Based on great work by khantaalaman in #3673. Fixes #3489.
This commit is contained in:
@@ -607,6 +607,17 @@ function send_message(request) {
|
||||
}
|
||||
}
|
||||
|
||||
exports.enter_with_preview_open = function () {
|
||||
clear_preview_area();
|
||||
if (page_params.enter_sends) {
|
||||
// If enter_sends is enabled, we just send the message
|
||||
send_message();
|
||||
} else {
|
||||
// Otherwise, we return to the compose box and focus it
|
||||
$("#new_message_content").focus();
|
||||
}
|
||||
};
|
||||
|
||||
exports.respond_to_message = function (opts) {
|
||||
var message;
|
||||
var msg_type;
|
||||
|
||||
Reference in New Issue
Block a user