From f5621f86417b0b57b742e71f1c167b046901888d Mon Sep 17 00:00:00 2001 From: Ulrich-Matthias Schäfer Date: Sun, 3 Sep 2023 07:21:41 +0200 Subject: allow 0 as animation duration and delay (fixes #1125) --- .gitignore | 3 ++- src/animation/Runner.js | 14 +++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 680a751..5330493 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,5 @@ spec/es5TestBundle.js .env dist index.html -index.js \ No newline at end of file +index.js +todo.md \ No newline at end of file diff --git a/src/animation/Runner.js b/src/animation/Runner.js index a83a02f..4ad222f 100644 --- a/src/animation/Runner.js +++ b/src/animation/Runner.js @@ -72,18 +72,18 @@ export default class Runner extends EventTarget { let times = 1 let swing = false let wait = 0 - duration = duration || timeline.duration - delay = delay || timeline.delay + duration = duration ?? timeline.duration + delay = delay ?? timeline.delay when = when || 'last' // If we have an object, unpack the values if (typeof duration === 'object' && !(duration instanceof Stepper)) { - delay = duration.delay || delay - when = duration.when || when + delay = duration.delay ?? delay + when = duration.when ?? when swing = duration.swing || swing - times = duration.times || times - wait = duration.wait || wait - duration = duration.duration || timeline.duration + times = duration.times ?? times + wait = duration.wait ?? wait + duration = duration.duration ?? timeline.duration } return { -- cgit v1.2.3