From 7b4da226172cbdda0d7db401d85b7b9e9793652e Mon Sep 17 00:00:00 2001 From: danielvincent Date: Sat, 18 Dec 2010 18:49:10 -0800 Subject: [PATCH] shift+enter for a newline, enter for submission. inversion of current implementation. --- public/javascripts/stream.js | 6 ++++-- public/javascripts/view.js | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/public/javascripts/stream.js b/public/javascripts/stream.js index 4505ada98..356985aae 100644 --- a/public/javascripts/stream.js +++ b/public/javascripts/stream.js @@ -17,8 +17,10 @@ var Stream = { // comment submit action $stream.delegate("textarea.comment_box", "keydown", function(e){ - if (e.shiftKey && e.keyCode === 13) { - $(this).closest("form").submit(); + if (e.keyCode === 13) { + if(!e.shiftKey) { + $(this).closest("form").submit(); + } } }); diff --git a/public/javascripts/view.js b/public/javascripts/view.js index edb3f8ca1..9c45e737c 100644 --- a/public/javascripts/view.js +++ b/public/javascripts/view.js @@ -128,8 +128,10 @@ var View = { publisher: { keydown: function(e) { - if(e.shiftKey && e.keyCode === 13) { - $(this).closest("form").submit(); + if(e.keyCode === 13) { + if(!e.shiftKey) { + $(this).closest("form").submit(); + } } }, selector: "#publisher textarea"