From f63d6d5b6791aca39cafde3c9ca06f04395b4685 Mon Sep 17 00:00:00 2001 From: martin <74269598+martabal@users.noreply.github.com> Date: Tue, 26 Sep 2023 04:53:26 +0200 Subject: [PATCH] fix(web): escape shortcut (#3753) * fix: escape shortcut * feat: more escape scenarios * feat: more escape shortcuts --------- Co-authored-by: Jason Rasmussen --- .../album-page/edit-description-modal.svelte | 13 ++++----- .../asset-viewer/asset-viewer.svelte | 4 +++ .../lib/components/elements/dropdown.svelte | 2 +- .../map-page/map-settings-modal.svelte | 6 ++-- .../actions/create-shared-link.svelte | 12 +++++++- .../photos-page/actions/delete-assets.svelte | 9 ++++++ .../components/photos-page/asset-grid.svelte | 4 +-- .../shared-components/base-modal.svelte | 1 + .../shared-components/confirm-dialogue.svelte | 7 ++++- .../context-menu/context-menu.svelte | 1 + .../create-shared-link-modal.svelte | 2 +- .../full-screen-modal.svelte | 12 ++++++-- .../navigation-bar/navigation-bar.svelte | 6 +++- .../search-bar/search-bar.svelte | 3 +- .../shared-components/show-shortcuts.svelte | 2 +- web/src/lib/utils/click-outside.ts | 3 +- web/src/routes/(user)/albums/+page.svelte | 2 +- .../(user)/albums/[albumId]/+page.svelte | 29 ++++++++++++++++++- .../(user)/people/[personId]/+page.svelte | 19 +++++++++++- web/src/routes/(user)/photos/+page.svelte | 26 +++++++++++++++-- web/src/routes/(user)/search/+page.svelte | 4 +++ 21 files changed, 140 insertions(+), 27 deletions(-) diff --git a/web/src/lib/components/album-page/edit-description-modal.svelte b/web/src/lib/components/album-page/edit-description-modal.svelte index 2b9b7e7447..e8bb68da46 100644 --- a/web/src/lib/components/album-page/edit-description-modal.svelte +++ b/web/src/lib/components/album-page/edit-description-modal.svelte @@ -6,18 +6,17 @@ const dispatch = createEventDispatcher<{ close: void; - updated: string; + save: string; }>(); export let album: AlbumResponseDto; let description = album.description; - const handleSave = () => { - dispatch('updated', description); - }; + const handleCancel = () => dispatch('close'); + const handleSubmit = () => dispatch('save', description); - dispatch('close')}> +
@@ -27,7 +26,7 @@

Edit description

-
+
@@ -42,7 +41,7 @@
- +
diff --git a/web/src/lib/components/asset-viewer/asset-viewer.svelte b/web/src/lib/components/asset-viewer/asset-viewer.svelte index fd156d6225..446075a489 100644 --- a/web/src/lib/components/asset-viewer/asset-viewer.svelte +++ b/web/src/lib/components/asset-viewer/asset-viewer.svelte @@ -120,6 +120,10 @@ isShowDeleteConfirmation = true; return; case 'Escape': + if (isShowDeleteConfirmation) { + isShowDeleteConfirmation = false; + return; + } closeViewer(); return; case 'f': diff --git a/web/src/lib/components/elements/dropdown.svelte b/web/src/lib/components/elements/dropdown.svelte index b6b7a17b49..570b5f84da 100644 --- a/web/src/lib/components/elements/dropdown.svelte +++ b/web/src/lib/components/elements/dropdown.svelte @@ -33,7 +33,7 @@ $: icon = icons?.[index]; -