Cause shift-enter to insert a newline, even if enter sends.

This fixes Trac #1018.

(imported from commit 9f1bc3ef3c86077a8852ba7fd23a184a4eac9e68)
This commit is contained in:
Waseem Daher
2013-02-27 23:41:32 -05:00
parent 41c0605fe6
commit dcba1e3f46

View File

@@ -99,7 +99,10 @@ function handle_keydown(e) {
// If no typeaheads are shown and the user has configured enter to send,
// then make enter send instead of inserting a line break.
if (e.target.id === "new_message_content" && code === 13 && enter_sends) {
// (Unless shift is being held down, which we *do* want to insert a linebreak)
if (e.target.id === "new_message_content"
&& code === 13 && !e.shiftKey
&& enter_sends) {
e.preventDefault();
compose.finish();
}