From a0d607ecaa3cd228e322c7f210756a820c0a9a63 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Fri, 5 Sep 2008 00:54:15 -0400 Subject: [PATCH] return in the status textarea will submit the form darcs-hash:20080905045415-84dde-bbb6947b53479c2b0f3060094431835784fa686b.gz --- js/util.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/js/util.js b/js/util.js index 1e782127d7..e68a6bab2e 100644 --- a/js/util.js +++ b/js/util.js @@ -18,7 +18,11 @@ $(document).ready(function(){ // count character on keyup - function counter(){ + function counter(event){ + if (event.keyCode == 13) { + $("#status_form").submit(); + } + var maxLength = 140; var currentLength = $("#status_textarea").val().length; var remaining = maxLength - currentLength; @@ -32,8 +36,9 @@ $(document).ready(function(){ } } + $("#status_textarea").bind("keyup", counter); + if ($("#status_textarea").length) { - $("#status_textarea").bind("keyup", counter); // run once in case there's something in there counter(); }