Skip to content

Commit

Permalink
chore: linting fixes in CarouselProgressBar
Browse files Browse the repository at this point in the history
  • Loading branch information
aweebs authored and ferferga committed Feb 17, 2023
1 parent b4183a9 commit 4b17b55
Showing 1 changed file with 17 additions and 21 deletions.
38 changes: 17 additions & 21 deletions frontend/src/components/Layout/Carousel/CarouselProgressBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ export default defineComponent({
unmounted() {
const animEndFunction = this.onAnimationEnd;
this.bars.forEach((element: HTMLElement) => {
for (const element of this.bars) {
element.removeEventListener('animationend', animEndFunction);
});
}
},
methods: {
updateBars(): void {
Expand All @@ -109,24 +109,20 @@ export default defineComponent({
activeBar.addEventListener('animationend', animEndFunction);
}
if (previousBars) {
window.requestAnimationFrame(() => {
previousBars.forEach((element: HTMLElement) => {
element.classList.remove('active', 'paused');
element.removeEventListener('animationend', animEndFunction);
element.classList.add('passed');
});
});
}
window.requestAnimationFrame(() => {
for (const element of previousBars) {
element.classList.remove('active', 'paused');
element.removeEventListener('animationend', animEndFunction);
element.classList.add('passed');
}
});
if (followingBars) {
window.requestAnimationFrame(() => {
followingBars.forEach((element: HTMLElement) => {
element.classList.remove('active', 'passed', 'paused');
element.removeEventListener('animationend', animEndFunction);
});
});
}
window.requestAnimationFrame(() => {
for (const element of followingBars) {
element.classList.remove('active', 'passed', 'paused');
element.removeEventListener('animationend', animEndFunction);
}
});
},
onAnimationEnd(): void {
this.$emit('on-animation-end');
Expand All @@ -144,9 +140,9 @@ export default defineComponent({
setAnimationDuration(): void {
const newDuration = (this.duration / 1000).toString() + 's';
this.bars.forEach((element: HTMLElement) => {
for (const element of this.bars) {
element.style.animationDuration = newDuration;
});
}
}
}
});
Expand Down

0 comments on commit 4b17b55

Please sign in to comment.