Skip to content

Commit 8316f4d

Browse files
committed
Fix offset on tooltip when 4 menu buttons are available
1 parent e9a108d commit 8316f4d

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

src/components/layout/SideBarMenuView.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
<div class="relative">
6464
{#each get(Menus.getMenuStore()) as menu, id}
6565
<MenuButton
66+
tooltipOffset={menu.tooltipOffset}
6667
onClickFunction={() => {
6768
navigate(menu.navigationPath);
6869
}}

src/components/menus/MenuButton.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@
1212

1313
<script lang="ts">
1414
import { t } from '../../i18n';
15+
import type { MenuProperties } from '../../lib/navigation/Menus';
1516
import Information from '../ui/information/Information.svelte';
1617
1718
export let title: string;
1819
export let helpTitle: string;
1920
export let helpDescription: string;
2021
export let onClickFunction: () => void;
2122
export let isExpanded: boolean;
23+
export let tooltipOffset: MenuProperties['tooltipOffset'] = {x: -100, y: 30};
2224
</script>
2325

2426
<div>
@@ -43,7 +45,7 @@
4345
<div class="absolute top-3px right-12">
4446
<Information
4547
bodyText={$t(helpDescription)}
46-
boxOffset={{ x: -200, y: 30 }}
48+
boxOffset={tooltipOffset}
4749
titleText={$t(helpTitle)}
4850
width={280} />
4951
</div>

src/lib/navigation/Menus.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export interface MenuProperties {
2121
collapsedButtonContent: typeof SvelteComponent<any> | undefined;
2222
expandedButtonContent: typeof SvelteComponent<any>;
2323
additionalExpandPaths?: PathType[];
24+
tooltipOffset?: {x: number, y: number};
2425
};
2526

2627
/**
@@ -63,6 +64,7 @@ class Menus {
6364
collapsedButtonContent: undefined,
6465
expandedButtonContent: ModelMenu,
6566
navigationPath: Paths.MODEL,
67+
tooltipOffset: {x: -100, y: -250}
6668
},
6769
]
6870
: [

0 commit comments

Comments
 (0)