#91 fixed comment

This commit is contained in:
Serraniel 2020-10-28 22:35:54 +01:00
parent b256fa8e5e
commit 3dad248447
Signed by: Serraniel
GPG key ID: 3690B4E7364525D3

View file

@ -51,10 +51,10 @@ function updateCharCounter(textarea, charCounterSpan) {
charCounterSpan.innerText = `${current} / ${max}`;
// animation if at max
// this need to be delayed because removing and adding it too fast again will prevent the browsers to replay the animation
if (current >= max && !charCounterSpan.classList.contains(SHAKE_CLASS)) {
charCounterSpan.classList.add(SHAKE_CLASS);
// remove css class after animation finished, so it can be restarted again
setTimeout(() => {
charCounterSpan.classList.remove(SHAKE_CLASS);
}, 200);