Added effects to user lists

This commit is contained in:
Eduard Urbach 2017-07-19 13:21:01 +02:00
parent e57e67610f
commit 39e6853d7d
2 changed files with 11 additions and 3 deletions

View File

@ -20,4 +20,5 @@ component Users(users []*arn.User)
.user-avatars .user-avatars
each user in users each user in users
.mountable
Avatar(user) Avatar(user)

View File

@ -468,19 +468,26 @@ export class AnimeNotifier {
} }
modifyDelayed(className: string, func: (element: HTMLElement) => void) { modifyDelayed(className: string, func: (element: HTMLElement) => void) {
const delay = 20
const maxDelay = 1000 const maxDelay = 1000
const delay = 20
let time = 0 let time = 0
let start = Date.now() let start = Date.now()
let maxTime = start + maxDelay let maxTime = start + maxDelay
let collection = document.getElementsByClassName(className)
let mutations = [] let mutations = []
let mountableTypes = { let mountableTypes = {
general: start general: start
} }
let collection = document.getElementsByClassName(className)
if(collection.length === 0) {
return
}
// let delay = Math.min(maxDelay / collection.length, 20)
for(let i = 0; i < collection.length; i++) { for(let i = 0; i < collection.length; i++) {
let element = collection.item(i) as HTMLElement let element = collection.item(i) as HTMLElement
let type = element.dataset.mountableType || "general" let type = element.dataset.mountableType || "general"