Skip to content

refactor(snack-bar): remove overly broad animation variables #10405

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 14, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 3 additions & 10 deletions src/lib/snack-bar/snack-bar-animations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,6 @@ import {
} from '@angular/animations';
import {AnimationCurves, AnimationDurations} from '@angular/material/core';

/** @docs-private */
export const SHOW_ANIMATION =
`${AnimationDurations.ENTERING} ${AnimationCurves.DECELERATION_CURVE}`;

/** @docs-private */
export const HIDE_ANIMATION =
`${AnimationDurations.EXITING} ${AnimationCurves.ACCELERATION_CURVE}`;

/** Animations used by the Material snack bar. */
export const matSnackBarAnimations: {
readonly contentFade: AnimationTriggerMetadata;
Expand All @@ -40,7 +32,8 @@ export const matSnackBarAnimations: {
snackBarState: trigger('state', [
state('visible-top, visible-bottom', style({transform: 'translateY(0%)'})),
transition('visible-top => hidden-top, visible-bottom => hidden-bottom',
animate(HIDE_ANIMATION)),
transition('void => visible-top, void => visible-bottom', animate(SHOW_ANIMATION)),
animate(`${AnimationDurations.EXITING} ${AnimationCurves.ACCELERATION_CURVE}`)),
transition('void => visible-top, void => visible-bottom',
animate(`${AnimationDurations.ENTERING} ${AnimationCurves.DECELERATION_CURVE}`)),
])
};