forked from GNUsocial/gnu-social
return in the status textarea will submit the form
darcs-hash:20080905045415-84dde-bbb6947b53479c2b0f3060094431835784fa686b.gz
This commit is contained in:
parent
96de63ea99
commit
a0d607ecaa
@ -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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user