Skip to content

Commit

Permalink
Experiment: allow to use the default file picker, see #2202
Browse files Browse the repository at this point in the history
  • Loading branch information
pietervdvn committed Nov 25, 2024
1 parent a94a7ec commit 86baf13
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/UI/Base/FileSelector.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { createEventDispatcher, onDestroy } from "svelte"
import { twMerge } from "tailwind-merge"
export let accept: string
export let accept: string | undefined
export let multiple: boolean = true
const dispatcher = createEventDispatcher<{ submit: FileList }>()
Expand Down
10 changes: 9 additions & 1 deletion src/UI/Image/UploadImage.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
<Tr t={error} cls="alert" />
{/each}
<FileSelector
accept="image/*"
accept=".jpg,.jpeg"
cls="button border-2 flex flex-col"
multiple={true}
on:submit={(e) => handleFiles(e.detail)}
Expand All @@ -122,6 +122,14 @@
{/if}
</div>
</FileSelector>
<FileSelector
accept={undefined}
cls="subtle as-link flex justify-center md:hidden"
multiple={true}
on:submit={(e) => handleFiles(e.detail)}
>
Use the file selector dialog
</FileSelector>
<div class="subtle text-xs italic">
<Tr t={Translations.t.general.attribution.panoramaxLicenseCCBYSA} />
<span class="mx-1">—</span>
Expand Down

0 comments on commit 86baf13

Please sign in to comment.