feat(web): Add select all button to all views (#2714)
* Add select all to photos
* Add selection of favorites
* Add select all button to albums
* Add select all to archive
* Add select all to search
* try to fix identation
* Revert "try to fix identation"
This reverts commit 40c727b74a.
* try to fix identation
* try to fix identation
* try to fix identation
* try to fix identation
* fix bucketposition
* Run prettier
---------
Co-authored-by: Yonggan <yonggan@obco.pro>
This commit is contained in:
@@ -17,6 +17,8 @@
|
||||
import Plus from 'svelte-material-icons/Plus.svelte';
|
||||
import Error from '../../+error.svelte';
|
||||
import type { PageData } from './$types';
|
||||
import CircleIconButton from '$lib/components/elements/buttons/circle-icon-button.svelte';
|
||||
import SelectAll from 'svelte-material-icons/SelectAll.svelte';
|
||||
|
||||
let favorites: AssetResponseDto[] = [];
|
||||
let selectedAssets: Set<AssetResponseDto> = new Set();
|
||||
@@ -38,6 +40,10 @@
|
||||
}
|
||||
});
|
||||
|
||||
const handleSelectAll = () => {
|
||||
selectedAssets = new Set(favorites);
|
||||
};
|
||||
|
||||
const onAssetDelete = (assetId: string) => {
|
||||
favorites = favorites.filter((a) => a.id !== assetId);
|
||||
};
|
||||
@@ -48,6 +54,7 @@
|
||||
<AssetSelectControlBar assets={selectedAssets} clearSelect={() => (selectedAssets = new Set())}>
|
||||
<FavoriteAction removeFavorite onAssetFavorite={(asset) => onAssetDelete(asset.id)} />
|
||||
<CreateSharedLink />
|
||||
<CircleIconButton title="Select all" logo={SelectAll} on:click={handleSelectAll} />
|
||||
<AssetSelectContextMenu icon={Plus} title="Add">
|
||||
<AddToAlbum />
|
||||
<AddToAlbum shared />
|
||||
|
||||
Reference in New Issue
Block a user