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:
parent
932d1fb7ce
commit
b2e9d23b84
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user