Respect enter-to-send in edit box

(imported from commit 6e3fc6495b7012aa12728a78b8bdd95701bb21e1)
This commit is contained in:
Leo Franchi 2013-09-20 14:13:22 -04:00
parent d9dba41767
commit c5183427f3
1 changed files with 3 additions and 1 deletions

View File

@ -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);