From: Tom Adams Date: Thu, 6 Aug 2009 22:13:05 +0000 (+0100) Subject: Set counter text only when it differs from the new remaining count. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=b2e9d23b843ab799e2601607f3a9580b1f82ac5d;p=quix0rs-gnu-social.git Set counter text only when it differs from the new remaining count. This speeds up keyboard navigation around the textarea field. --- diff --git a/js/util.js b/js/util.js index ef147bef4a..1ab711cd13 100644 --- a/js/util.js +++ b/js/util.js @@ -23,7 +23,9 @@ $(document).ready(function(){ var currentLength = $("#notice_data-text").val().length; var remaining = maxLength - currentLength; var counter = $("#notice_text-count"); - counter.text(remaining); + if (counter.text() != String(remaining)) { + counter.text(remaining); + } if (remaining < 0) { $("#form_notice").addClass("warning");