From c5183427f31c6021b1b86c787db0b627aa572228 Mon Sep 17 00:00:00 2001 From: Leo Franchi Date: Fri, 20 Sep 2013 14:13:22 -0400 Subject: [PATCH] Respect enter-to-send in edit box (imported from commit 6e3fc6495b7012aa12728a78b8bdd95701bb21e1) --- static/js/message_edit.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/static/js/message_edit.js b/static/js/message_edit.js index a282850862..1c205c32d8 100644 --- a/static/js/message_edit.js +++ b/static/js/message_edit.js @@ -54,7 +54,9 @@ function handle_edit_keydown(e) { var row, code = e.keyCode || e.which; if (e.target.id === "message_edit_content" && code === 13 && - (e.metaKey || e.ctrlKey)) { + (e.metaKey || e.ctrlKey || (page_params.enter_sends && !e.shiftKey))) { + e.preventDefault(); + row = $(".message_edit_content").filter(":focus").closest(".message_row"); if (message_edit.save(row) === true) { message_edit.end(row);