aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/dumbymap.mjs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/dumbymap.mjs b/src/dumbymap.mjs
index 2ea5b0c..f85251a 100644
--- a/src/dumbymap.mjs
+++ b/src/dumbymap.mjs
@@ -387,15 +387,17 @@ export const generateMaps = (container, { delay, mapCallback }) => {
387 ).length 387 ).length
388 const total = steps.length 388 const total = steps.length
389 passNum += `/${total}` 389 passNum += `/${total}`
390 if (results.filter(r => r.type === 'render').length === total) { 390
391 passNum += '\u0020' 391 const final = results.filter(r => r.type === 'render').length === total
392 }
393 392
394 // FIXME HACK use MutationObserver for animation 393 // FIXME HACK use MutationObserver for animation
395 if (!target.animations) target.animations = Promise.resolve() 394 if (!target.animations) target.animations = Promise.resolve()
396 target.animations = target.animations.then(async () => { 395 target.animations = target.animations.then(async () => {
397 await new Promise(resolve => setTimeout(resolve, 100)) 396 await new Promise(resolve => setTimeout(resolve, 100))
397 if (final) passNum += '\x20'
398 target.setAttribute('data-report', passNum) 398 target.setAttribute('data-report', passNum)
399
400 if (final) setTimeout(() => target.removeAttribute('data-report'), 100)
399 }) 401 })
400 } 402 }
401 /** 403 /**