adds waypoint images
This commit is contained in:
@@ -15,7 +15,7 @@
|
|||||||
(photoFiles ?? []).map(async (f) => {
|
(photoFiles ?? []).map(async (f) => {
|
||||||
return await readAsDataURLAsync(f);
|
return await readAsDataURLAsync(f);
|
||||||
}),
|
}),
|
||||||
).then((v) => {
|
).then((v) => {
|
||||||
photoPreviews = v;
|
photoPreviews = v;
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -59,20 +59,7 @@
|
|||||||
if (!photoFiles) {
|
if (!photoFiles) {
|
||||||
photoFiles = [];
|
photoFiles = [];
|
||||||
}
|
}
|
||||||
photoFiles.push(file);
|
photoFiles = [...photoFiles, file]
|
||||||
|
|
||||||
// (function (file) {
|
|
||||||
// var reader = new FileReader();
|
|
||||||
// reader.onload = function (e) {
|
|
||||||
// if (e.target?.result) {
|
|
||||||
// photoPreviews = [
|
|
||||||
// ...photoPreviews,
|
|
||||||
// e.target.result as string,
|
|
||||||
// ];
|
|
||||||
// }
|
|
||||||
// };
|
|
||||||
// reader.readAsDataURL(file);
|
|
||||||
// })(file);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -40,13 +40,16 @@
|
|||||||
class="flex gap-4 p-4 border border-input-border rounded-md my-2 hover:bg-menu-item-background-hover"
|
class="flex gap-4 p-4 border border-input-border rounded-md my-2 hover:bg-menu-item-background-hover"
|
||||||
>
|
>
|
||||||
{#if imgSrc.length}
|
{#if imgSrc.length}
|
||||||
<PhotoGallery
|
{#if mode == "show"}
|
||||||
photos={waypoint.photos.map((p) => getFileURL(waypoint, p))}
|
<PhotoGallery
|
||||||
bind:open={openGallery}
|
photos={waypoint.photos.map((p) => getFileURL(waypoint, p))}
|
||||||
></PhotoGallery>
|
bind:open={openGallery}
|
||||||
|
></PhotoGallery>
|
||||||
|
{/if}
|
||||||
<button
|
<button
|
||||||
class="relative basis-16 aspect-square ml-2 mb-3 shrink-0"
|
class="relative basis-16 aspect-square ml-2 mb-3 shrink-0"
|
||||||
on:click={() => openGallery()}
|
type="button"
|
||||||
|
on:click={mode == "show" ? () => openGallery() : undefined}
|
||||||
>
|
>
|
||||||
{#each imgSrc as img, i}
|
{#each imgSrc as img, i}
|
||||||
<img
|
<img
|
||||||
|
|||||||
Reference in New Issue
Block a user