return in the status textarea will submit the form

darcs-hash:20080905045415-84dde-bbb6947b53479c2b0f3060094431835784fa686b.gz
This commit is contained in:
Evan Prodromou 2008-09-05 00:54:15 -04:00
parent 96de63ea99
commit a0d607ecaa
1 changed files with 7 additions and 2 deletions

View File

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