From 1667d6a98ca482850745c7c1d81c7afd001ad9fe Mon Sep 17 00:00:00 2001 From: JovannMC Date: Mon, 6 Jan 2025 18:52:08 +0300 Subject: [PATCH] Show "Set all to" Shows the "Set all to" option all the time, defaulting to being disabled with "N/A" until a file is uploaded --- .../functional/ConversionPanel.svelte | 17 +++++++++++------ src/lib/components/functional/Dropdown.svelte | 8 +++++--- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/lib/components/functional/ConversionPanel.svelte b/src/lib/components/functional/ConversionPanel.svelte index 308d89d..4f75440 100644 --- a/src/lib/components/functional/ConversionPanel.svelte +++ b/src/lib/components/functional/ConversionPanel.svelte @@ -5,7 +5,9 @@ import Dropdown from "./Dropdown.svelte"; - +
+

Set all to

{#if files.requiredConverters.length === 1} -

Set all to

files.files.forEach((f) => { - f.to = r; - f.result = null; - })} + onselect={(r) => + files.files.forEach((f) => { + f.to = r; + f.result = null; + })} options={files.files[0]?.converter?.supportedFormats || []} /> + {:else} + {/if}
diff --git a/src/lib/components/functional/Dropdown.svelte b/src/lib/components/functional/Dropdown.svelte index e9764ab..33d2028 100644 --- a/src/lib/components/functional/Dropdown.svelte +++ b/src/lib/components/functional/Dropdown.svelte @@ -1,20 +1,21 @@