Feature/#91 watch2gether display chat message character count #93

Merged
Serraniel merged 12 commits from feature/#91-watch2gether-display-chat-message-character-count into develop 2020-10-29 18:09:12 +01:00
Showing only changes of commit 3dad248447 - Show all commits

View file

@ -51,10 +51,10 @@ function updateCharCounter(textarea, charCounterSpan) {
charCounterSpan.innerText = `${current} / ${max}`; charCounterSpan.innerText = `${current} / ${max}`;
// animation if at 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)) { if (current >= max && !charCounterSpan.classList.contains(SHAKE_CLASS)) {
charCounterSpan.classList.add(SHAKE_CLASS); charCounterSpan.classList.add(SHAKE_CLASS);
// remove css class after animation finished, so it can be restarted again
setTimeout(() => { setTimeout(() => {
charCounterSpan.classList.remove(SHAKE_CLASS); charCounterSpan.classList.remove(SHAKE_CLASS);
}, 200); }, 200);