1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-01-22 11:42:46 +01:00

Add select all button to albums

This commit is contained in:
Yonggan 2023-06-10 14:04:31 +02:00
parent 026ffbe133
commit 25a0a62f6a
2 changed files with 8 additions and 3 deletions

View file

@ -34,6 +34,7 @@
import CreateSharedLinkModal from '../shared-components/create-share-link-modal/create-shared-link-modal.svelte';
import GalleryViewer from '../shared-components/gallery-viewer/gallery-viewer.svelte';
import ImmichLogo from '../shared-components/immich-logo.svelte';
import SelectAll from 'svelte-material-icons/SelectAll.svelte';
import {
NotificationType,
notificationController
@ -44,6 +45,7 @@
import ThumbnailSelection from './thumbnail-selection.svelte';
import UserSelectionModal from './user-selection-modal.svelte';
import { handleError } from '../../utils/handle-error';
import {selectedAssets} from "$lib/stores/asset-interaction.store";
export let album: AlbumResponseDto;
export let sharedLink: SharedLinkResponseDto | undefined = undefined;
@ -333,6 +335,10 @@
isShowShareUserSelection = false;
isShowShareLinkModal = true;
};
const handleSelectAll = () => {
multiSelectAsset = new Set(album.assets)
}
</script>
<section class="bg-immich-bg dark:bg-immich-dark-bg" class:hidden={isShowThumbnailSelection}>
@ -342,7 +348,7 @@
assets={multiSelectAsset}
clearSelect={() => (multiSelectAsset = new Set())}
>
<SelectAllAssets/>
<CircleIconButton title="Delete" logo={SelectAll} on:click={handleSelectAll}/>
<DownloadAction filename={album.albumName} sharedLinkKey={sharedLink?.key} />
{#if isOwned}
<RemoveFromAlbum bind:album />

View file

@ -12,7 +12,6 @@
import GalleryViewer from '$lib/components/shared-components/gallery-viewer/gallery-viewer.svelte';
import CircleIconButton from '$lib/components/elements/buttons/circle-icon-button.svelte';
import SelectAll from 'svelte-material-icons/SelectAll.svelte';
import TimerSand from 'svelte-material-icons/TimerSand.svelte';
import {handleError} from '$lib/utils/handle-error';
import {api, AssetResponseDto} from '@api';
import {onMount} from 'svelte';
@ -54,7 +53,7 @@
<AssetSelectControlBar assets={selectedAssets} clearSelect={() => (selectedAssets = new Set())}>
<FavoriteAction removeFavorite onAssetFavorite={(asset) => onAssetDelete(asset.id)}/>
<CreateSharedLink/>
<CircleIconButton title="Delete" logo={SelectAll} on:click={handleSelectAll}/>
<CircleIconButton title="Delete" logo={SelectAll} on:click={handleSelectAll}/>
<AssetSelectContextMenu icon={Plus} title="Add">
<AddToAlbum/>
<AddToAlbum shared/>