mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
feat: handle escape key and higher wheel zoom ratio (#3471)
This commit is contained in:
parent
95c75c289c
commit
e368b9e50b
5 changed files with 63 additions and 12 deletions
|
|
@ -11,6 +11,7 @@
|
|||
import { flip } from 'svelte/animate';
|
||||
import { archivedAsset } from '$lib/stores/archived-asset.store';
|
||||
import { getThumbnailSize } from '$lib/utils/thumbnail-util';
|
||||
import { isViewingAssetStoreState } from '$lib/stores/asset-interaction.store';
|
||||
|
||||
export let assets: AssetResponseDto[];
|
||||
export let sharedLink: SharedLinkResponseDto | undefined = undefined;
|
||||
|
|
@ -19,8 +20,6 @@
|
|||
export let viewFrom: ViewFrom;
|
||||
export let showArchiveIcon = false;
|
||||
|
||||
let isShowAssetViewer = false;
|
||||
|
||||
let selectedAsset: AssetResponseDto;
|
||||
let currentViewAssetIndex = 0;
|
||||
|
||||
|
|
@ -34,7 +33,7 @@
|
|||
|
||||
currentViewAssetIndex = assets.findIndex((a) => a.id == asset.id);
|
||||
selectedAsset = assets[currentViewAssetIndex];
|
||||
isShowAssetViewer = true;
|
||||
$isViewingAssetStoreState = true;
|
||||
pushState(selectedAsset.id);
|
||||
};
|
||||
|
||||
|
|
@ -82,7 +81,7 @@
|
|||
};
|
||||
|
||||
const closeViewer = () => {
|
||||
isShowAssetViewer = false;
|
||||
$isViewingAssetStoreState = false;
|
||||
history.pushState(null, '', `${$page.url.pathname}`);
|
||||
};
|
||||
|
||||
|
|
@ -118,7 +117,7 @@
|
|||
{/if}
|
||||
|
||||
<!-- Overlay Asset Viewer -->
|
||||
{#if isShowAssetViewer}
|
||||
{#if $isViewingAssetStoreState}
|
||||
<AssetViewer
|
||||
asset={selectedAsset}
|
||||
publicSharedKey={sharedLink?.key}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue