fixed start page icons

This commit is contained in:
Eugene Pankov 2019-06-30 23:35:48 +02:00
parent 269971ab60
commit 3c27e8105e
2 changed files with 8 additions and 2 deletions

View File

@ -1,14 +1,14 @@
div
.terminus-logo
h1.terminus-title Terminus
sup α
sup α
.list-group
a.list-group-item.list-group-item-action.d-flex(
*ngFor='let button of getButtons()',
(click)='button.click()',
)
.d-flex.align-self-center([innerHTML]='button.icon')
.d-flex.align-self-center([innerHTML]='sanitizeIcon(button.icon)')
span {{button.title}}
footer.d-flex.align-items-center

View File

@ -1,4 +1,5 @@
import { Component, Inject } from '@angular/core'
import { DomSanitizer } from '@angular/platform-browser'
import { ConfigService } from '../services/config.service'
import { HomeBaseService } from '../services/homeBase.service'
import { ToolbarButton, ToolbarButtonProvider } from '../api'
@ -14,6 +15,7 @@ export class StartPageComponent {
constructor (
private config: ConfigService,
private domSanitizer: DomSanitizer,
public homeBase: HomeBaseService,
@Inject(ToolbarButtonProvider) private toolbarButtonProviders: ToolbarButtonProvider[],
) {
@ -26,4 +28,8 @@ export class StartPageComponent {
.filter(x => !!x.click)
.sort((a: ToolbarButton, b: ToolbarButton) => (a.weight || 0) - (b.weight || 0))
}
sanitizeIcon (icon: string): any {
return this.domSanitizer.bypassSecurityTrustHtml(icon || '')
}
}