From 85c6cf4309a673649c195d99fd8bf045141b8496 Mon Sep 17 00:00:00 2001 From: Michel Heusschen <59014050+michelheusschen@users.noreply.github.com> Date: Sun, 21 May 2023 18:01:08 +0200 Subject: [PATCH] fix(web): context menu overlap + outclick types (#2506) --- web/src/app.d.ts | 5 ++- .../asset-viewer/asset-viewer-nav-bar.svelte | 14 ++++---- .../asset-select-context-menu.svelte | 2 +- .../context-menu/context-menu.svelte | 36 ++++++++----------- .../context-menu/menu-option.svelte | 17 ++------- web/src/lib/utils/click-outside.ts | 12 +++++-- web/src/routes/(user)/albums/+page.svelte | 2 +- 7 files changed, 36 insertions(+), 52 deletions(-) diff --git a/web/src/app.d.ts b/web/src/app.d.ts index 85440fd432..a568cc816b 100644 --- a/web/src/app.d.ts +++ b/web/src/app.d.ts @@ -25,10 +25,9 @@ declare namespace App { // Source: https://stackoverflow.com/questions/63814432/typescript-typing-of-non-standard-window-event-in-svelte // To fix the { - oncopyImage?: () => void; - onoutclick?: () => void; + 'on:copyImage'?: () => void; } } diff --git a/web/src/lib/components/asset-viewer/asset-viewer-nav-bar.svelte b/web/src/lib/components/asset-viewer/asset-viewer-nav-bar.svelte index 2ab3df1df8..7ea7ac2843 100644 --- a/web/src/lib/components/asset-viewer/asset-viewer-nav-bar.svelte +++ b/web/src/lib/components/asset-viewer/asset-viewer-nav-bar.svelte @@ -128,14 +128,12 @@ title="More" > {#if isShowAssetOptions} - -
- onMenuClick('addToAlbum')} text="Add to Album" /> - onMenuClick('addToSharedAlbum')} - text="Add to Shared Album" - /> -
+ + onMenuClick('addToAlbum')} text="Add to Album" /> + onMenuClick('addToSharedAlbum')} + text="Add to Shared Album" + /> {/if} diff --git a/web/src/lib/components/photos-page/asset-select-context-menu.svelte b/web/src/lib/components/photos-page/asset-select-context-menu.svelte index 7be7de4ed6..b5f9e6348f 100644 --- a/web/src/lib/components/photos-page/asset-select-context-menu.svelte +++ b/web/src/lib/components/photos-page/asset-select-context-menu.svelte @@ -27,7 +27,7 @@ {#if showContextMenu} - (showContextMenu = false)}> + (showContextMenu = false)}>
diff --git a/web/src/lib/components/shared-components/context-menu/context-menu.svelte b/web/src/lib/components/shared-components/context-menu/context-menu.svelte index 9d58359c0f..aafd9f5d67 100644 --- a/web/src/lib/components/shared-components/context-menu/context-menu.svelte +++ b/web/src/lib/components/shared-components/context-menu/context-menu.svelte @@ -1,41 +1,33 @@ diff --git a/web/src/lib/components/shared-components/context-menu/menu-option.svelte b/web/src/lib/components/shared-components/context-menu/menu-option.svelte index 6bd63174d1..ff435b191a 100644 --- a/web/src/lib/components/shared-components/context-menu/menu-option.svelte +++ b/web/src/lib/components/shared-components/context-menu/menu-option.svelte @@ -1,22 +1,11 @@