Skip to content

Commit

Permalink
fix(toast): create unique toast id
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdbradley committed Apr 21, 2016
1 parent 95af318 commit e07f0ae
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ionic/components/toast/toast.ts
Expand Up @@ -120,6 +120,7 @@ class ToastCmp {
private descId: string;
private hdrId: string;
private created: number;
private id: number;
private dismissTimeout: number = undefined;

constructor(
Expand All @@ -138,8 +139,9 @@ class ToastCmp {
renderer.setElementClass(_elementRef.nativeElement, this.d.cssClass, true);
}

this.id = (++toastIds);
if (this.d.message) {
this.hdrId = 'acst-hdr-' + this.id;
this.hdrId = 'toast-hdr-' + this.id;
}
}

Expand Down Expand Up @@ -290,3 +292,5 @@ Transition.register('toast-md-slide-in', ToastMdSlideIn);
Transition.register('toast-md-slide-out', ToastMdSlideOut);
Transition.register('toast-wp-slide-out', ToastWpPopOut);
Transition.register('toast-wp-slide-in', ToastWpPopIn);

let toastIds = -1;

0 comments on commit e07f0ae

Please sign in to comment.