Skip to content

Commit

Permalink
feat(igxCollapsible): Add animation parrams. #307
Browse files Browse the repository at this point in the history
  • Loading branch information
IvayloG committed Aug 23, 2018
1 parent 7371330 commit 47f6085
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ export class IgxCollapsibleHeaderComponent {
return !this.collapsible.collapsed;
}


constructor(@Host() public collapsible: IgxCollapsibleComponent, public cdr: ChangeDetectorRef,
public elementRef: ElementRef, private renderer: Renderer2) { }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
import { IgxRippleModule } from '../directives/ripple/ripple.directive';
import { AnimationBuilder, AnimationReferenceMetadata, AnimationMetadataType, AnimationAnimateRefMetadata } from '@angular/animations';
import { IAnimationParams } from '../animations/main';
import { slideOutBottom, slideOutTop} from '../animations/main';
import { slideOutTop, slideInTop } from '../animations/main';

let NEXT_ID = 0;

Expand Down Expand Up @@ -55,7 +55,7 @@ export class IgxCollapsibleBodyDirective {
export class IgxCollapsibleComponent {

animationSettings: { openAnimation: AnimationReferenceMetadata, closeAnimation: AnimationReferenceMetadata } = {
openAnimation: slideOutBottom,
openAnimation: slideInTop,
closeAnimation: slideOutTop
};

Expand Down Expand Up @@ -130,7 +130,7 @@ export class IgxCollapsibleComponent {
private body: QueryList<ElementRef>;

private playOpenAnimation(cb: () => void) {

this.animationSettings.openAnimation.options.params.fromPosition = 'translateY(-50px)';
const animationBuilder = this.builder.build(this.animationSettings.openAnimation);
const openAnimationPlayer = animationBuilder.create(this.body.first.nativeElement);

Expand All @@ -143,6 +143,7 @@ export class IgxCollapsibleComponent {
}

private playCloseAnimation(cb: () => void) {
this.animationSettings.closeAnimation.options.params.toPosition = 'translateY(-50px)';
const animationBuilder = this.builder.build(this.animationSettings.closeAnimation);
const closeAnimationPlayer = animationBuilder.create(this.body.first.nativeElement);

Expand Down

0 comments on commit 47f6085

Please sign in to comment.