Skip to content
This repository was archived by the owner on Nov 30, 2022. It is now read-only.

Commit

Permalink
feat(icon): disable animation for the component
Browse files Browse the repository at this point in the history
  • Loading branch information
marcjulian committed Nov 25, 2019
1 parent d0307b2 commit 2d45f85
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
10 changes: 5 additions & 5 deletions projects/core/src/lib/icon/icon.component.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<ion-icon [slot]="slot" class="icon" [@.disabled]="animationDisabled" [@rotateAnim]="state"
(@rotateAnim.done)="rotateAnimDone($event)" [name]="_name" [color]="color"></ion-icon>
<span [@.disabled]="animationDisabled" [@scaleAnim]="indicatorState" *ngIf="dot" class="indicator-dot"></span>
<ion-icon [slot]="slot" class="icon" [@rotateAnim]="state" (@rotateAnim.done)="rotateAnimDone($event)" [name]="_name"
[color]="color"></ion-icon>
<span [@scaleAnim]="indicatorState" *ngIf="dot" class="indicator-dot"></span>
<span class="off-background" *ngIf="off"></span>
<span class="off" *ngIf="off"></span>
<span *ngIf="smallIcon && badge == 0 && !dot" class="indicator-small-icon">
<ion-icon [color]="color" slot="icon-only" [name]="smallIcon"></ion-icon>
</span>
<span *ngIf="badge > 0 && !dot" [@.disabled]="animationDisabled" [@scaleAnim]="badgeState"
(@scaleAnim.done)="incrementDone($event)" class="indicator-badge">
<span *ngIf="badge > 0 && !dot" [@scaleAnim]="badgeState" (@scaleAnim.done)="incrementDone($event)"
class="indicator-badge">
<span *ngIf="badge <= 9">{{badge}}</span>
<span *ngIf="badge > 9">9+</span>
</span>
9 changes: 7 additions & 2 deletions projects/core/src/lib/icon/icon.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import {
Input,
ChangeDetectionStrategy,
Output,
EventEmitter
EventEmitter,
HostBinding
} from '@angular/core';
import {
trigger,
Expand Down Expand Up @@ -59,7 +60,11 @@ export class FivIcon implements OnInit {
@Input() slot: string;
@Input() smallIcon: string;
@Input() off = false;
@Input() animationDisabled = false;

@Input()
@HostBinding('@.disabled')
animationDisabled = false;

@Output() transitionDone = new EventEmitter<string>();

indicatorState: 'normal' | 'scale' = 'scale';
Expand Down

0 comments on commit 2d45f85

Please sign in to comment.