aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/dumbymap.mjs
diff options
context:
space:
mode:
Diffstat (limited to 'src/dumbymap.mjs')
-rw-r--r--src/dumbymap.mjs12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/dumbymap.mjs b/src/dumbymap.mjs
index 4ffe58e..9a38e24 100644
--- a/src/dumbymap.mjs
+++ b/src/dumbymap.mjs
@@ -254,13 +254,15 @@ export const generateMaps = async (container, callback) => {
254 const placeholder = htmlHolder.querySelector(`[data-placeholder="${target.id}"]`) 254 const placeholder = htmlHolder.querySelector(`[data-placeholder="${target.id}"]`)
255 if (!placeholder) throw Error(`Cannot fine placeholder for map "${target.id}"`) 255 if (!placeholder) throw Error(`Cannot fine placeholder for map "${target.id}"`)
256 256
257 const afterAnimation = () => {
258 placeholder.parentElement.replaceChild(target, placeholder)
259 target.style = placeholder.style.cssText
260 placeholder.remove()
261 }
257 animateRectTransition(target, placeholder.getBoundingClientRect()) 262 animateRectTransition(target, placeholder.getBoundingClientRect())
258 .finished 263 .finished
259 .finally(() => { 264 .then(afterAnimation)
260 placeholder.parentElement.replaceChild(target, placeholder) 265 .catch(afterAnimation)
261 target.style = placeholder.style.cssText
262 placeholder.remove()
263 })
264 } 266 }
265 }) 267 })
266 // }}} 268 // }}}