]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Removed some DOM lookups in the char counter
authormatthew.gregg <matthew.gregg@gmail.com>
Wed, 25 Jun 2008 12:58:47 +0000 (08:58 -0400)
committermatthew.gregg <matthew.gregg@gmail.com>
Wed, 25 Jun 2008 12:58:47 +0000 (08:58 -0400)
darcs-hash:20080625125847-982e4-b4c1c644fe07a43c61062ae3d9302148ab925088.gz

js/util.js

index 59a48917029097ce2d15f09d32735aec2f4a563a..7eae496fd0b184a584d3833d7aad5ec217a6b254 100644 (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", "");
                 }
         }