Delay DOM mutation

This commit is contained in:
Eduard Urbach 2018-12-08 07:12:41 +09:00
parent 3776b87d7e
commit 07a8bb0ffa

View File

@ -933,8 +933,11 @@ export default class AnimeNotifier {
let minutes = Math.trunc(time / 60)
let seconds = Math.trunc(time) % 60
let paddedSeconds = ("00" + seconds).slice(-2)
timeElement.textContent = `${minutes}:${paddedSeconds}`
progressElement.style.transform = `scaleX(${time / video.duration})`
Diff.mutations.queue(() => {
timeElement.textContent = `${minutes}:${paddedSeconds}`
progressElement.style.transform = `scaleX(${time / video.duration})`
})
})
video.addEventListener("waiting", () => {