]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Set counter text only when it differs from the new remaining count.
authorTom Adams <tom@holizz.com>
Thu, 6 Aug 2009 22:13:05 +0000 (23:13 +0100)
committerTom Adams <tom@holizz.com>
Thu, 6 Aug 2009 22:17:23 +0000 (23:17 +0100)
This speeds up keyboard navigation around the textarea field.

js/util.js

index ef147bef4a79ac241da814b53ec62bd2abb6a738..1ab711cd134747f2762d6a813cb647c4938957a0 100644 (file)
@@ -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");