Skip to content

Commit

Permalink
fix(menu): improves menu swipe animation
Browse files Browse the repository at this point in the history
  • Loading branch information
manucorporat committed Nov 23, 2016
1 parent 51a492a commit 91478ed
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/animations/animation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1016,7 +1016,7 @@ export class Animation {
if (dur < 0) {
dur = this._dur;
}
this._isAsync = (currentStepValue > 0.05 && currentStepValue < 0.95 && dur > 30);
this._isAsync = (dur > 30);

this._progressEnd(shouldComplete, stepValue, dur, this._isAsync);

Expand Down
3 changes: 2 additions & 1 deletion src/components/menu/menu-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ export class MenuType {
done(isOpen);
}, true);

let dur = this.ani.getDuration() / (Math.abs(velocity) + 1);
let factor = 1 - Math.min(Math.abs(velocity) / 4, 0.7);
let dur = this.ani.getDuration() * factor;

this.ani.progressEnd(shouldComplete, currentStepValue, dur);
}
Expand Down

0 comments on commit 91478ed

Please sign in to comment.