Skip to content

Commit

Permalink
fix(app): remove old theme class from overlay container before settin…
Browse files Browse the repository at this point in the history
…g of new one
  • Loading branch information
tomastrajan committed Jan 26, 2018
1 parent 4e71253 commit 4358ac5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,12 @@ export class AppComponent implements OnInit, OnDestroy {
)
.subscribe(theme => {
this.componentCssClass = theme;
this.overlayContainer.getContainerElement().classList.add(theme);
const classList = this.overlayContainer.getContainerElement().classList;
const toRemove = Array.from(classList).filter((item: string) =>
item.includes('-theme')
);
classList.remove(...toRemove);
classList.add(theme);
});
this.store
.select(selectorAuth)
Expand Down

0 comments on commit 4358ac5

Please sign in to comment.