mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
feat(web): better context menu position (#4271)
* feat(web): better context menu position * fix: album context menu * fix: add middle variant * fix: rest of context menus * fix: linting error
This commit is contained in:
parent
3e73cfb71a
commit
68d6d89a3b
8 changed files with 40 additions and 29 deletions
|
|
@ -10,6 +10,7 @@
|
|||
import CircleIconButton from '$lib/components/elements/buttons/circle-icon-button.svelte';
|
||||
import ContextMenu from '$lib/components/shared-components/context-menu/context-menu.svelte';
|
||||
import type Icon from 'svelte-material-icons/AbTesting.svelte';
|
||||
import { getContextMenuPosition } from '$lib/utils/context-menu';
|
||||
|
||||
export let icon: typeof Icon;
|
||||
export let title: string;
|
||||
|
|
@ -17,9 +18,8 @@
|
|||
let showContextMenu = false;
|
||||
let contextMenuPosition = { x: 0, y: 0 };
|
||||
|
||||
const handleShowMenu = ({ x }: MouseEvent) => {
|
||||
const navigationBarHeight = 75;
|
||||
contextMenuPosition = { x: x, y: navigationBarHeight };
|
||||
const handleShowMenu = (event: MouseEvent) => {
|
||||
contextMenuPosition = getContextMenuPosition(event, 'top-left');
|
||||
showContextMenu = !showContextMenu;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue