- {#if showShareButton}
-
dispatch('showShareModal')}
- title={$t('share')}
- />
+ {#if !asset.isTrashed && $user}
+
{/if}
{#if asset.isOffline}
- dispatch('showDetail')}
- title={$t('asset_offline')}
- />
+
{/if}
- {#if showMotionPlayButton}
- {#if isMotionPhotoPlaying}
- dispatch('stopMotionPhoto')}
- />
- {:else}
- dispatch('playMotionPhoto')}
- />
- {/if}
+ {#if asset.livePhotoVideoId}
+
{/if}
- {#if showZoomButton}
+ {#if asset.type === AssetTypeEnum.Image}
{/if}
- {#if showCopyButton}
+ {#if canCopyImagesToClipboard() && asset.type === AssetTypeEnum.Image}
{/if}
{#if !isOwner && showDownloadButton}
- dispatch('download')}
- title={$t('download')}
- />
+
{/if}
{#if showDetailButton}
- dispatch('showDetail')}
- title={$t('info')}
- />
+
{/if}
{#if isOwner}
- dispatch('favorite')}
- title={asset.isFavorite ? $t('unfavorite') : $t('to_favorite')}
- />
+
{/if}
{#if isOwner}
- dispatch('delete')}
- on:permanentlyDelete={() => dispatch('permanentlyDelete')}
- />
+
+
{#if showSlideshow}
- onMenuClick('playSlideShow')} text={$t('slideshow')} />
+
{/if}
{#if showDownloadButton}
- onMenuClick('download')} text={$t('download')} />
+
{/if}
{#if asset.isTrashed}
- onMenuClick('restoreAsset')} text={$t('restore')} />
+
{:else}
- onMenuClick('addToAlbum')} text={$t('add_to_album')} />
- onMenuClick('addToSharedAlbum')}
- text={$t('add_to_shared_album')}
- />
+
+
{/if}
{#if isOwner}
{#if hasStackChildren}
- onMenuClick('unstack')} text={$t('unstack')} />
+
{/if}
{#if album}
- onMenuClick('setAsAlbumCover')}
- />
+
{/if}
{#if asset.type === AssetTypeEnum.Image}
- onMenuClick('asProfileImage')}
- text={$t('set_as_profile_picture')}
- />
+
{/if}
- onMenuClick('toggleArchive')}
- icon={asset.isArchived ? mdiArchiveArrowUpOutline : mdiArchiveArrowDownOutline}
- text={asset.isArchived ? $t('unarchive') : $t('to_archive')}
- />
+
openFileUploadDialog({ multiple: false, assetId: asset.id })}
@@ -224,18 +135,18 @@
onJobClick(AssetJobName.RefreshMetadata)}
+ onClick={() => onRunJob(AssetJobName.RefreshMetadata)}
text={$getAssetJobName(AssetJobName.RefreshMetadata)}
/>
onJobClick(AssetJobName.RegenerateThumbnail)}
+ onClick={() => onRunJob(AssetJobName.RegenerateThumbnail)}
text={$getAssetJobName(AssetJobName.RegenerateThumbnail)}
/>
{#if asset.type === AssetTypeEnum.Video}
onJobClick(AssetJobName.TranscodeVideo)}
+ onClick={() => onRunJob(AssetJobName.TranscodeVideo)}
text={$getAssetJobName(AssetJobName.TranscodeVideo)}
/>
{/if}
diff --git a/web/src/lib/components/asset-viewer/asset-viewer.svelte b/web/src/lib/components/asset-viewer/asset-viewer.svelte
index f216d73382..24b65f8b1b 100644
--- a/web/src/lib/components/asset-viewer/asset-viewer.svelte
+++ b/web/src/lib/components/asset-viewer/asset-viewer.svelte
@@ -1,25 +1,21 @@
- navigateAsset('previous') },
- { shortcut: { key: 'ArrowRight' }, onShortcut: () => navigateAsset('next') },
- { shortcut: { key: 'd', shift: true }, onShortcut: () => downloadFile(asset) },
- { shortcut: { key: 'Delete' }, onShortcut: () => trashOrDelete(asset.isTrashed) },
- { shortcut: { key: 'Delete', shift: true }, onShortcut: () => trashOrDelete(true) },
- { shortcut: { key: 'Escape' }, onShortcut: closeViewer },
- { shortcut: { key: 'f' }, onShortcut: toggleFavorite },
- { shortcut: { key: 'i' }, onShortcut: toggleDetailPanel },
- ]}
-/>
-
0}
- showShareButton={shouldShowShareModal}
+ hasStackChildren={stackedAssets.length > 0}
onZoomImage={zoomToggle}
onCopyImage={copyImage}
- on:back={closeViewer}
- on:showDetail={showDetailInfoHandler}
- on:download={() => downloadFile(asset)}
- on:delete={() => trashOrDelete()}
- on:permanentlyDelete={() => trashOrDelete(true)}
- on:favorite={toggleFavorite}
- on:addToAlbum={() => openAlbumPicker(false)}
- on:restoreAsset={() => handleRestoreAsset()}
- on:addToSharedAlbum={() => openAlbumPicker(true)}
- on:playMotionPhoto={() => (shouldPlayMotionPhoto = true)}
- on:stopMotionPhoto={() => (shouldPlayMotionPhoto = false)}
- on:toggleArchive={toggleAssetArchive}
- on:asProfileImage={() => (isShowProfileImageCrop = true)}
- on:setAsAlbumCover={handleUpdateThumbnail}
- on:runJob={({ detail: job }) => handleRunJob(job)}
- on:playSlideShow={() => ($slideshowState = SlideshowState.PlaySlideshow)}
- on:unstack={handleUnstack}
- on:showShareModal={() => (isShowShareModal = true)}
- />
+ onAction={handleAction}
+ onRunJob={handleRunJob}
+ onPlaySlideshow={() => ($slideshowState = SlideshowState.PlaySlideshow)}
+ onShowDetail={toggleDetailPanel}
+ onClose={closeViewer}
+ >
+ (shouldPlayMotionPhoto = shouldPlay)}
+ />
+
{/if}
{#if $slideshowState === SlideshowState.None && showNavigation}
{/if}
@@ -698,9 +505,7 @@
{#if $slideshowState === SlideshowState.None && showNavigation}