Removed some DOM lookups in the char counter

darcs-hash:20080625125847-982e4-b4c1c644fe07a43c61062ae3d9302148ab925088.gz
This commit is contained in:
matthew.gregg 2008-06-25 08:58:47 -04:00
parent 240989994d
commit c0ac127a68
1 changed files with 4 additions and 3 deletions

View File

@ -4,12 +4,13 @@ $(document).ready(function(){
var maxLength = 140;
var currentLength = $("#status_textarea").val().length;
var remaining = 140 - currentLength;
$("#counter").text(remaining);
var counter = $("#counter");
counter.text(remaining);
if(remaining <= 0) {
$("#counter").attr("class", "toomuch");
counter.attr("class", "toomuch");
} else {
$("#counter").attr("class", "");
counter.attr("class", "");
}
}