From c0ac127a68ad5dbdeb2da1ec4ba4a15f353adb6a Mon Sep 17 00:00:00 2001 From: "matthew.gregg" Date: Wed, 25 Jun 2008 08:58:47 -0400 Subject: [PATCH] Removed some DOM lookups in the char counter darcs-hash:20080625125847-982e4-b4c1c644fe07a43c61062ae3d9302148ab925088.gz --- js/util.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/js/util.js b/js/util.js index 59a4891702..7eae496fd0 100644 --- a/js/util.js +++ b/js/util.js @@ -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", ""); } }