diff options
author | Hsieh Chin Fan <pham@topo.tw> | 2024-09-20 01:02:03 +0800 |
---|---|---|
committer | Hsieh Chin Fan <pham@topo.tw> | 2024-09-20 01:03:15 +0800 |
commit | 90e1959daecff370c76b50d281cf0c6001e3f991 (patch) | |
tree | 2555a14603ac500427b25ec38814a27ea54ae29b /src/dumbymap.mjs | |
parent | 7d71b5ed922c5f8472c63a6eaa3fb07f351f1c65 (diff) |
style: eslint
Diffstat (limited to 'src/dumbymap.mjs')
-rw-r--r-- | src/dumbymap.mjs | 12 |
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 | // }}} |