Forum improvements

This commit is contained in:
2017-06-26 15:17:53 +02:00
parent d197fb30fb
commit 8c19f0be72
10 changed files with 67 additions and 24 deletions

View File

@ -136,19 +136,19 @@ export class AnimeNotifier {
modifyDelayed(className: string, func: (element: HTMLElement) => void) {
const delay = 20
const maxDelay = 1000
const maxDelay = 500
let time = 0
for(let element of findAll(className)) {
setTimeout(() => {
window.requestAnimationFrame(() => func(element))
}, time)
time += delay
if(time > maxDelay) {
time = maxDelay
func(element)
} else {
setTimeout(() => {
window.requestAnimationFrame(() => func(element))
}, time)
}
}
}