This commit is contained in:
vcoppe
2024-05-23 11:21:57 +02:00
parent f202b6c196
commit 51495e9bd1
16 changed files with 211 additions and 148 deletions

View File

@@ -4,6 +4,21 @@ import { fileObservers } from "$lib/db";
export const selection = writable<SelectionTreeType>(new SelectionTreeType(new ListRootItem()));
export function select(fileId: string) {
selection.update(($selection) => {
$selection.clear();
$selection.set(new ListFileItem(fileId), true);
return $selection;
});
}
export function addSelect(fileId: string) {
selection.update(($selection) => {
$selection.toggle(new ListFileItem(fileId));
return $selection;
});
}
export function selectAll() {
selection.update(($selection) => {
get(fileObservers).forEach((_file, fileId) => {