shift+enter for a newline, enter for submission. inversion of current implementation.

This commit is contained in:
danielvincent 2010-12-18 18:49:10 -08:00
parent 78a50756c6
commit 7b4da22617
2 changed files with 8 additions and 4 deletions

View file

@ -17,9 +17,11 @@ var Stream = {
// comment submit action // comment submit action
$stream.delegate("textarea.comment_box", "keydown", function(e){ $stream.delegate("textarea.comment_box", "keydown", function(e){
if (e.shiftKey && e.keyCode === 13) { if (e.keyCode === 13) {
if(!e.shiftKey) {
$(this).closest("form").submit(); $(this).closest("form").submit();
} }
}
}); });
$stream.delegate("textarea.comment_box", "focus", function(evt) { $stream.delegate("textarea.comment_box", "focus", function(evt) {

View file

@ -128,9 +128,11 @@ var View = {
publisher: { publisher: {
keydown: function(e) { keydown: function(e) {
if(e.shiftKey && e.keyCode === 13) { if(e.keyCode === 13) {
if(!e.shiftKey) {
$(this).closest("form").submit(); $(this).closest("form").submit();
} }
}
}, },
selector: "#publisher textarea" selector: "#publisher textarea"
}, },