Skip to content

Commit

Permalink
Pick multiple images
Browse files Browse the repository at this point in the history
  • Loading branch information
SnowCait committed Oct 13, 2023
1 parent f287a33 commit 8b2464d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion web/src/routes/editor/MediaPicker.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
import { createEventDispatcher } from 'svelte';
import IconPhoto from '@tabler/icons-svelte/dist/svelte/icons/IconPhoto.svelte';
export let multiple = false;
let input: HTMLInputElement | undefined;
let files: FileList;
Expand All @@ -11,7 +13,7 @@
<button on:click|preventDefault={() => input?.click()} class="clear">
<IconPhoto size="30" />
</button>
<input type="file" bind:this={input} bind:files on:change={() => dispatch('pick', files)} accept="image/*" hidden>
<input type="file" {multiple} bind:this={input} bind:files on:change={() => dispatch('pick', files)} accept="image/*" hidden>

<style>
button {
Expand Down
2 changes: 1 addition & 1 deletion web/src/routes/editor/NoteEditor.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@
/>
<div class="actions">
<div class="options">
<MediaPicker on:pick={mediaPicked} />
<MediaPicker multiple={true} on:pick={mediaPicked} />
<EmojiPickerSlide bind:this={emojiPickerSlide} on:pick={onEmojiPick} />
<ContentWarning bind:reason={contentWarningReason} />
</div>
Expand Down

0 comments on commit 8b2464d

Please sign in to comment.