Don't display alt for actor images
We don't need it since it's just a "cosmetic" image
This commit is contained in:
parent
b52f504848
commit
145d7da2de
|
@ -1,5 +1,5 @@
|
||||||
<ng-template #img>
|
<ng-template #img>
|
||||||
<img *ngIf="displayImage()" [class]="classes" [src]="previewImage || avatarUrl || defaultAvatarUrl" [alt]="alt" />
|
<img *ngIf="displayImage()" [class]="classes" [src]="previewImage || avatarUrl || defaultAvatarUrl" alt="" />
|
||||||
|
|
||||||
<div *ngIf="displayActorInitial()" [ngClass]="classes">
|
<div *ngIf="displayActorInitial()" [ngClass]="classes">
|
||||||
<span>{{ getActorInitial() }}</span>
|
<span>{{ getActorInitial() }}</span>
|
||||||
|
|
|
@ -43,20 +43,17 @@ export class ActorAvatarComponent implements OnInit, OnChanges {
|
||||||
}
|
}
|
||||||
|
|
||||||
classes: string[] = []
|
classes: string[] = []
|
||||||
alt: string
|
|
||||||
defaultAvatarUrl: string
|
defaultAvatarUrl: string
|
||||||
avatarUrl: string
|
avatarUrl: string
|
||||||
|
|
||||||
ngOnInit () {
|
ngOnInit () {
|
||||||
this.buildDefaultAvatarUrl()
|
this.buildDefaultAvatarUrl()
|
||||||
|
|
||||||
this.buildAlt()
|
|
||||||
this.buildAvatarUrl()
|
this.buildAvatarUrl()
|
||||||
this.buildClasses()
|
this.buildClasses()
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnChanges () {
|
ngOnChanges () {
|
||||||
this.buildAlt()
|
|
||||||
this.buildAvatarUrl()
|
this.buildAvatarUrl()
|
||||||
this.buildClasses()
|
this.buildClasses()
|
||||||
}
|
}
|
||||||
|
@ -81,12 +78,6 @@ export class ActorAvatarComponent implements OnInit, OnChanges {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private buildAlt () {
|
|
||||||
if (this.isAccount()) this.alt = $localize`Account avatar`
|
|
||||||
else if (this.isChannel()) this.alt = $localize`Channel avatar`
|
|
||||||
else this.alt = ''
|
|
||||||
}
|
|
||||||
|
|
||||||
private buildDefaultAvatarUrl () {
|
private buildDefaultAvatarUrl () {
|
||||||
this.defaultAvatarUrl = this.isChannel()
|
this.defaultAvatarUrl = this.isChannel()
|
||||||
? VideoChannel.GET_DEFAULT_AVATAR_URL(this.getSizeNumber())
|
? VideoChannel.GET_DEFAULT_AVATAR_URL(this.getSizeNumber())
|
||||||
|
|
Loading…
Reference in New Issue