Set counter text only when it differs from the new remaining count.

This speeds up keyboard navigation around the textarea field.
This commit is contained in:
Tom Adams 2009-08-06 23:13:05 +01:00
parent 932d1fb7ce
commit b2e9d23b84
1 changed files with 3 additions and 1 deletions

View 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");