Merge pull request #2509 from mempool/nymkappa/bugfix/location-hover

Show tooltip on location is truncated
This commit is contained in:
wiz 2022-09-12 05:17:10 +09:00 committed by GitHub
commit 0a645431ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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);
}
}