add contextmenu actions to edit menu

This commit is contained in:
vcoppe
2024-06-27 18:23:11 +02:00
parent aad5cf8770
commit 804a155257
7 changed files with 141 additions and 27 deletions

View File

@@ -344,6 +344,15 @@ export function exportFile(file: GPXFile) {
URL.revokeObjectURL(url);
}
export const anyHidden = writable(false);
function updateAnyHidden() {
anyHidden.set(get(selection).getSelected().some((item) => {
let layer = gpxLayers.get(item.getFileId());
return layer && layer.hidden;
}));
}
selection.subscribe(updateAnyHidden);
export function toggleSelectionVisibility() {
let files = new Set<string>();
get(selection).forEach((item) => {
@@ -355,6 +364,7 @@ export function toggleSelectionVisibility() {
layer.toggleVisibility();
}
});
updateAnyHidden();
}
export function hideSelection() {
@@ -368,6 +378,7 @@ export function hideSelection() {
layer.toggleVisibility();
}
});
anyHidden.set(true);
}
export function showSelection() {
@@ -381,8 +392,12 @@ export function showSelection() {
layer.toggleVisibility();
}
});
anyHidden.set(false);
}
export const editMetadata = writable(false);
export const editStyle = writable(false);
let stravaCookies: any = null;
function refreshStravaCookies() {
/*