summaryrefslogtreecommitdiff
path: root/static/alert-timeout.js
blob: 6fe6def28a25c106aae2bd6965962ae02b66ca67 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
Array.from(document.getElementsByClassName('kysAlert')).forEach( (a) => {
        a.addEventListener('click', (event) => {
            event.target.remove();
        })
        setTimeout( () => {
            Array.from(document.getElementsByClassName('kysAlert'))
                    .forEach( (a) => {
                if (a.style.transition=="opacity 2s") a.remove()
                a.style.transition="opacity 2s"
                a.style.opacity=0;
            } )
        }, 5000)
    })