From 0208f8c900e757b425ad5da9e0688af95c7c7b45 Mon Sep 17 00:00:00 2001 From: Stu Cork Date: Fri, 15 Oct 2021 11:18:01 +0800 Subject: [PATCH 1/2] Make duration an optional keyword argument --- client_code/animation.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/client_code/animation.py b/client_code/animation.py index 601dc742..f9ddc0d4 100644 --- a/client_code/animation.py +++ b/client_code/animation.py @@ -354,16 +354,17 @@ class Effect: The first argument should be a Transition object. The remainder of the values are timing options""" - def __new__(cls, transition=None, **timings): + def __new__(cls, transition=None, duration=333, **timings): if isinstance(transition, Transition): transition = transition._compute() + timings["duration"] = duration return _window.KeyframeEffect(None, transition, timings) def __init__( self, transition=None, - *, duration=333, + *, delay=0, direction="normal", easing="linear", @@ -392,8 +393,8 @@ def getTiming(self, component): def animate( component, transition=None, - *, duration=333, + *, start_at=None, end_at=None, use_ghost=False, From 9afd9d74647f971b8975eb3366dc719d786e50a9 Mon Sep 17 00:00:00 2001 From: Stu Cork Date: Sat, 16 Oct 2021 18:27:01 +0800 Subject: [PATCH 2/2] update change log --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 466ffe14..6f2348be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ * `on_form_load()` can be used in a `routing.main_router` Form This method will be fired with the current `url_hash` and the `form` that was added to the `content_panel`. https://github.com/anvilistas/anvil-extras/pull/180 +* `animate` duration argument is no longer keyword only i.e. `animate(self, fade_in, 300)` is valid + https://github.com/anvilistas/anvil-extras/pull/182 # v1.8.1 14-Oct-2021