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

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");
if (counter.text() != String(remaining)) {
counter.text(remaining);
}
if (remaining < 0) {
$("#form_notice").addClass("warning");