From c2d649d3f4cbbe17e9aad3a9c4252a0f6687b02a Mon Sep 17 00:00:00 2001 From: natsoni Date: Tue, 16 Apr 2024 16:02:39 +0200 Subject: [PATCH 1/2] Improve tooltip position in block overview on mobile --- .../block-overview-tooltip.component.html | 2 +- .../block-overview-tooltip.component.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/src/app/components/block-overview-tooltip/block-overview-tooltip.component.html b/frontend/src/app/components/block-overview-tooltip/block-overview-tooltip.component.html index 505171f9d..63e2933d5 100644 --- a/frontend/src/app/components/block-overview-tooltip/block-overview-tooltip.component.html +++ b/frontend/src/app/components/block-overview-tooltip/block-overview-tooltip.component.html @@ -3,7 +3,7 @@ class="block-overview-tooltip" [class.clickable]="clickable" [style.visibility]="tx ? 'visible' : 'hidden'" - [style.left]="tooltipPosition.x + 'px'" + [style.left]="getTooltipLeftPosition()" [style.top]="tooltipPosition.y + 'px'" > diff --git a/frontend/src/app/components/block-overview-tooltip/block-overview-tooltip.component.ts b/frontend/src/app/components/block-overview-tooltip/block-overview-tooltip.component.ts index e77dec716..f397928fa 100644 --- a/frontend/src/app/components/block-overview-tooltip/block-overview-tooltip.component.ts +++ b/frontend/src/app/components/block-overview-tooltip/block-overview-tooltip.component.ts @@ -96,4 +96,8 @@ export class BlockOverviewTooltipComponent implements OnChanges { this.cd.markForCheck(); } } + + getTooltipLeftPosition(): string { + return window.innerWidth < 392 ? '-40px' : this.tooltipPosition.x + 'px'; + } } From 89ef5fe33d4549e57faa815fadc706fd14be99fb Mon Sep 17 00:00:00 2001 From: natsoni Date: Thu, 18 Apr 2024 11:09:28 +0200 Subject: [PATCH 2/2] Fix tooltip text overflow in some languages --- .../block-overview-tooltip.component.scss | 4 ++-- .../block-overview-tooltip.component.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/app/components/block-overview-tooltip/block-overview-tooltip.component.scss b/frontend/src/app/components/block-overview-tooltip/block-overview-tooltip.component.scss index df34ce346..507d4c18d 100644 --- a/frontend/src/app/components/block-overview-tooltip/block-overview-tooltip.component.scss +++ b/frontend/src/app/components/block-overview-tooltip/block-overview-tooltip.component.scss @@ -10,7 +10,7 @@ padding: 10px 15px; text-align: left; min-width: 340px; - max-width: 340px; + max-width: 400px; pointer-events: none; z-index: 11; @@ -41,7 +41,7 @@ th, td { flex-wrap: wrap; row-gap: 0.25em; margin-top: 0.2em; - max-width: 100%; + max-width: 310px; .badge { border-radius: 0.2rem; diff --git a/frontend/src/app/components/block-overview-tooltip/block-overview-tooltip.component.ts b/frontend/src/app/components/block-overview-tooltip/block-overview-tooltip.component.ts index f397928fa..d59bfa87f 100644 --- a/frontend/src/app/components/block-overview-tooltip/block-overview-tooltip.component.ts +++ b/frontend/src/app/components/block-overview-tooltip/block-overview-tooltip.component.ts @@ -98,6 +98,6 @@ export class BlockOverviewTooltipComponent implements OnChanges { } getTooltipLeftPosition(): string { - return window.innerWidth < 392 ? '-40px' : this.tooltipPosition.x + 'px'; + return window.innerWidth < 392 ? '-50px' : this.tooltipPosition.x + 'px'; } }