summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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();
}