mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2025-09-05 18:02:55 +00:00
progress
This commit is contained in:
@@ -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) => {
|
||||
|
Reference in New Issue
Block a user