summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Prodromou <evan@prodromou.name>2008-09-05 00:54:15 -0400
committerEvan Prodromou <evan@prodromou.name>2008-09-05 00:54:15 -0400
commita0d607ecaa3cd228e322c7f210756a820c0a9a63 (patch)
tree6699d369b9d5fda8b8a1d5ae83112fac5f52cca7
parent96de63ea99fbfff5ba2a773350d0e145fc6ed16a (diff)
return in the status textarea will submit the form
darcs-hash:20080905045415-84dde-bbb6947b53479c2b0f3060094431835784fa686b.gz
-rw-r--r--js/util.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/js/util.js b/js/util.js
index 1e782127d..e68a6bab2 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();
}