diff options
author | Tom Adams <tom@holizz.com> | 2009-08-06 23:13:05 +0100 |
---|---|---|
committer | Tom Adams <tom@holizz.com> | 2009-08-06 23:17:23 +0100 |
commit | b2e9d23b843ab799e2601607f3a9580b1f82ac5d (patch) | |
tree | 289415e488a9db5526a73db297293105b2f41b86 /js/util.js | |
parent | 932d1fb7ce06081c788ea088171fd69ef03cd394 (diff) |
Set counter text only when it differs from the new remaining count.
This speeds up keyboard navigation around the textarea field.
Diffstat (limited to 'js/util.js')
-rw-r--r-- | js/util.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/js/util.js b/js/util.js index ef147bef4..1ab711cd1 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"); |