mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
fix: Change shortcut listeners from window to document (#18416)
* fix: Change shortcut listeners to document * fix: split into window and document * chore: upgrade ui package
This commit is contained in:
parent
b2ef8ea7dd
commit
188188a844
25 changed files with 40 additions and 39 deletions
|
|
@ -36,7 +36,7 @@
|
|||
};
|
||||
</script>
|
||||
|
||||
<svelte:window
|
||||
<svelte:document
|
||||
use:shortcut={{ shortcut: { key: 'l', shift: shared }, onShortcut: () => (showSelectionModal = true) }}
|
||||
/>
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
};
|
||||
</script>
|
||||
|
||||
<svelte:window use:shortcut={{ shortcut: { key: 'a', shift: true }, onShortcut: onArchive }} />
|
||||
<svelte:document use:shortcut={{ shortcut: { key: 'a', shift: true }, onShortcut: onArchive }} />
|
||||
|
||||
<MenuOption
|
||||
icon={asset.isArchived ? mdiArchiveArrowUpOutline : mdiArchiveArrowDownOutline}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,6 @@
|
|||
let { onClose }: Props = $props();
|
||||
</script>
|
||||
|
||||
<svelte:window use:shortcut={{ shortcut: { key: 'Escape' }, onShortcut: onClose }} />
|
||||
<svelte:document use:shortcut={{ shortcut: { key: 'Escape' }, onShortcut: onClose }} />
|
||||
|
||||
<CircleIconButton color="opaque" icon={mdiArrowLeft} title={$t('go_back')} onclick={onClose} />
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@
|
|||
};
|
||||
</script>
|
||||
|
||||
<svelte:window
|
||||
<svelte:document
|
||||
use:shortcuts={[
|
||||
{ shortcut: { key: 'Delete' }, onShortcut: () => trashOrDelete(asset.isTrashed) },
|
||||
{ shortcut: { key: 'Delete', shift: true }, onShortcut: () => trashOrDelete(true) },
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
const onDownloadFile = async () => downloadFile(await getAssetInfo({ id: asset.id, key: authManager.key }));
|
||||
</script>
|
||||
|
||||
<svelte:window use:shortcut={{ shortcut: { key: 'd', shift: true }, onShortcut: onDownloadFile }} />
|
||||
<svelte:document use:shortcut={{ shortcut: { key: 'd', shift: true }, onShortcut: onDownloadFile }} />
|
||||
|
||||
{#if !menuItem}
|
||||
<CircleIconButton color="opaque" icon={mdiFolderDownloadOutline} title={$t('download')} onclick={onDownloadFile} />
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@
|
|||
};
|
||||
</script>
|
||||
|
||||
<svelte:window use:shortcut={{ shortcut: { key: 'f' }, onShortcut: toggleFavorite }} />
|
||||
<svelte:document use:shortcut={{ shortcut: { key: 'f' }, onShortcut: toggleFavorite }} />
|
||||
|
||||
<CircleIconButton
|
||||
color="opaque"
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
let { onNextAsset }: Props = $props();
|
||||
</script>
|
||||
|
||||
<svelte:window
|
||||
<svelte:document
|
||||
use:shortcuts={[
|
||||
{ shortcut: { key: 'ArrowRight' }, onShortcut: onNextAsset },
|
||||
{ shortcut: { key: 'd' }, onShortcut: onNextAsset },
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
let { onPreviousAsset }: Props = $props();
|
||||
</script>
|
||||
|
||||
<svelte:window
|
||||
<svelte:document
|
||||
use:shortcuts={[
|
||||
{ shortcut: { key: 'ArrowLeft' }, onShortcut: onPreviousAsset },
|
||||
{ shortcut: { key: 'a' }, onShortcut: onPreviousAsset },
|
||||
|
|
|
|||
|
|
@ -11,6 +11,6 @@
|
|||
let { onShowDetail }: Props = $props();
|
||||
</script>
|
||||
|
||||
<svelte:window use:shortcut={{ shortcut: { key: 'i' }, onShortcut: onShowDetail }} />
|
||||
<svelte:document use:shortcut={{ shortcut: { key: 'i' }, onShortcut: onShowDetail }} />
|
||||
|
||||
<CircleIconButton color="opaque" icon={mdiInformationOutline} onclick={onShowDetail} title={$t('info')} />
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@
|
|||
const onConfirm = () => (typeof $showCancelConfirmDialog === 'boolean' ? null : $showCancelConfirmDialog());
|
||||
</script>
|
||||
|
||||
<svelte:window use:shortcut={{ shortcut: { key: 'Escape' }, onShortcut: onClose }} />
|
||||
<svelte:document use:shortcut={{ shortcut: { key: 'Escape' }, onShortcut: onClose }} />
|
||||
|
||||
<section class="relative p-2 dark:bg-immich-dark-bg dark:text-immich-dark-fg">
|
||||
<div class="flex place-items-center gap-2">
|
||||
|
|
|
|||
|
|
@ -202,7 +202,7 @@
|
|||
let containerHeight = $state(0);
|
||||
</script>
|
||||
|
||||
<svelte:window
|
||||
<svelte:document
|
||||
use:shortcuts={[
|
||||
{ shortcut: { key: 'c', ctrl: true }, onShortcut: onCopyShortcut, preventDefault: false },
|
||||
{ shortcut: { key: 'c', meta: true }, onShortcut: onCopyShortcut, preventDefault: false },
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@
|
|||
};
|
||||
</script>
|
||||
|
||||
<svelte:window
|
||||
<svelte:document
|
||||
onmousemove={showControlBar}
|
||||
use:shortcuts={[
|
||||
{ shortcut: { key: 'Escape' }, onShortcut: onClose },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue