Skip to content

Commit

Permalink
chore(overlay): update sample to allow change of animations duration
Browse files Browse the repository at this point in the history
  • Loading branch information
wnvko committed Oct 4, 2021
1 parent 081af5f commit 550c0ed
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/app/overlay/overlay.sample.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@
<input igxInput name="dropDownWidth" type="number" [(ngModel)]="dropDownWidth">
<label igxLabel for="dropDownWidth">Drop down width</label>
</igx-input-group>
<igx-input-group>
<input igxInput name="animationLength" type="number" [(ngModel)]="animationLength">
<label igxLabel for="animationLength">Animation length in ms</label>
</igx-input-group>
</div>
</div>
<div #outlet class="outlet column">
Expand Down
8 changes: 7 additions & 1 deletion src/app/overlay/overlay.sample.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import {
NoOpScrollStrategy,
ElasticPositionStrategy,
IgxDragDirective,
ContainerPositionStrategy
ContainerPositionStrategy,
IAnimationParams
} from 'igniteui-angular';

@Component({
Expand Down Expand Up @@ -48,6 +49,7 @@ export class OverlaySampleComponent implements OnInit {
public closeOnOutsideClick = true;
public modal = true;
public useOutlet = false;
public animationLength = 300; // in ms

private xAddition = 0;
private yAddition = 0;
Expand Down Expand Up @@ -341,6 +343,10 @@ export class OverlaySampleComponent implements OnInit {
this.cdr.detectChanges();
this.onChange2();
this._overlaySettings.target = this.button.nativeElement;
(this._overlaySettings.positionStrategy.settings.openAnimation.options.params as IAnimationParams).duration
= `${this.animationLength}ms`;
(this._overlaySettings.positionStrategy.settings.closeAnimation.options.params as IAnimationParams).duration
= `${this.animationLength}ms`;
}
this.igxDropDown.toggle(this._overlaySettings);
}
Expand Down

0 comments on commit 550c0ed

Please sign in to comment.