Skip to content

Commit

Permalink
fix(icon): fix icon default class
Browse files Browse the repository at this point in the history
  • Loading branch information
alyleui committed Aug 29, 2018
1 parent 07ec903 commit 2ec8488
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div>
<ly-toolbar [withClass]="classes.header" bg="primary" elevation="3">
<button ly-icon-button (click)="nav.toggle()" class="material-icons">
menu
<button ly-icon-button (click)="nav.toggle()">
<ly-icon>menu</ly-icon>
</button>
<ly-toolbar-item class="logo">
<button ly-button color="primary:contrast" sensitive [routerLink]="['./']">
Expand Down
7 changes: 2 additions & 5 deletions src/lib/icon/icon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Platform, LyTheme2 } from '@alyle/ui';
@Directive({
selector: 'ly-icon'
})
export class Icon implements OnChanges, OnInit {
export class Icon implements OnInit {
private _defaultClass = 'material-icons';
private _src: string;
private _icon: string;
Expand Down Expand Up @@ -77,6 +77,7 @@ export class Icon implements OnChanges, OnInit {
}

ngOnInit() {
this._updateClass();
this.theme.addStyle('lyIconRoot', theme => (
`font-size:${theme.icon.fontSize};` +
`width:1em;` +
Expand All @@ -85,10 +86,6 @@ export class Icon implements OnChanges, OnInit {
), this.elementRef.nativeElement);
}

ngOnChanges() {
this._updateClass();
}

/**
* run only browser
* remove current icon
Expand Down

0 comments on commit 2ec8488

Please sign in to comment.