Show tooltip on location is truncated

This commit is contained in:
nymkappa 2022-09-04 12:02:40 +02:00
parent 9047cb5998
commit 206edb7613
No known key found for this signature in database
GPG key ID: E155910B16E8BD04
2 changed files with 12 additions and 1 deletions

View file

@ -1 +1,8 @@
<span class="d-block text-truncate" [innerHTML]="formattedLocation"></span>
<ng-template #formattedLocationHtml>
<span [innerHTML]="formattedLocation"></span>
</ng-template>
<span class="d-block text-truncate" [ngbTooltip]="formattedLocationHtml"
#formattedLocationEl [disableTooltip]="!isEllipsisActive(formattedLocationEl)">
<ng-template [ngTemplateOutlet]="formattedLocationHtml"></ng-template>
</span>

View file

@ -80,4 +80,8 @@ export class GeolocationComponent implements OnChanges {
return;
}
}
isEllipsisActive(e): boolean {
return (e.offsetWidth < e.scrollWidth);
}
}