Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
sei-bstein committed Feb 14, 2025
1 parent 6fa078c commit 026162e
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ export type AvatarSize = 'tiny' | 'small' | 'medium' | 'large';
styleUrls: ['./avatar.component.scss'],
template: `
<ng-template #tolTemplate>
<ng-content [select]="avatarTooltip"></ng-content>
<div #tooltipProjection>
<ng-content [select]="avatarTooltip"></ng-content>
</div>
</ng-template>
<div [class]="'avatar-container avatar-size ' + this.sizeClass" [style.background-image]="escapedImgUrl" [tooltip]="tolTemplate" [placement]="tooltipPlacement"></div>
<div [class]="'avatar-container avatar-size ' + this.sizeClass" [style.background-image]="escapedImgUrl" [tooltip]="tooltipProjection?.nativeElement?.children?.length ? tolTemplate : undefined" [placement]="tooltipPlacement"></div>
`,
})
export class AvatarComponent implements OnChanges {
Expand All @@ -20,6 +22,7 @@ export class AvatarComponent implements OnChanges {
@Input() tooltipPlacement = PlacementForBs5.top;

@ViewChild("searchBox") searchBox?: ElementRef<Input>;
@ViewChild("tooltipProjection") tooltipProjection?: ElementRef<HTMLDivElement>;

protected escapedImgUrl = "";
protected sizeClass = "avatar-size-medium";
Expand Down

0 comments on commit 026162e

Please sign in to comment.