Skip to content

Commit 8fd1a15

Browse files
authored
added reset parameter to stop function Animation controller (#730)
Added a reset parameter to the CoreAnimationController stop function, by default it's true so there are no regressions. The reason for this change is that currently if you use the stop function the values will reset to their start values which is not handy if you want to chain the same value to a different animation.
1 parent afb83ed commit 8fd1a15

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/core/animations/CoreAnimationController.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,16 @@ export class CoreAnimationController
6363
return this;
6464
}
6565

66-
stop(): IAnimationController {
66+
stop(reset = true): IAnimationController {
6767
this.unregisterAnimation();
6868
if (this.stoppedResolve !== null) {
6969
this.stoppedResolve();
7070
this.stoppedResolve = null;
7171
this.emit('stopped', this);
7272
}
73-
this.animation.reset();
73+
if (reset === true) {
74+
this.animation.reset();
75+
}
7476
this.state = 'stopped';
7577
return this;
7678
}

0 commit comments

Comments
 (0)