adds waypoint images
This commit is contained in:
@@ -59,20 +59,7 @@
|
||||
if (!photoFiles) {
|
||||
photoFiles = [];
|
||||
}
|
||||
photoFiles.push(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);
|
||||
photoFiles = [...photoFiles, 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"
|
||||
>
|
||||
{#if imgSrc.length}
|
||||
{#if mode == "show"}
|
||||
<PhotoGallery
|
||||
photos={waypoint.photos.map((p) => getFileURL(waypoint, p))}
|
||||
bind:open={openGallery}
|
||||
></PhotoGallery>
|
||||
{/if}
|
||||
<button
|
||||
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}
|
||||
<img
|
||||
|
||||
Reference in New Issue
Block a user