summaryrefslogtreecommitdiff
path: root/js/util.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/util.js')
-rw-r--r--js/util.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/js/util.js b/js/util.js
index 7eae496fd..4f2e7c724 100644
--- a/js/util.js
+++ b/js/util.js
@@ -1,7 +1,7 @@
$(document).ready(function(){
// count character on keyup
- function counter(){
- var maxLength = 140;
+ function counter(){
+ var maxLength = 140;
var currentLength = $("#status_textarea").val().length;
var remaining = 140 - currentLength;
var counter = $("#counter");
@@ -16,7 +16,8 @@ $(document).ready(function(){
if ($("#status_textarea").length) {
$("#status_textarea").bind("keyup", counter);
+ // run once in case there's something in there
+ counter();
}
-
});