From dc4db405d2991d3ec6a114f3b08d3fccd057d3ee Mon Sep 17 00:00:00 2001
From: Wolfgang Müller
Date: Thu, 13 Feb 2025 17:52:16 +0100
Subject: frontend: Migrate to Svelte 5

---
 frontend/src/lib/toolbar/MarkSelection.svelte | 37 +++++++++++++--------------
 1 file changed, 18 insertions(+), 19 deletions(-)

(limited to 'frontend/src/lib/toolbar/MarkSelection.svelte')

diff --git a/frontend/src/lib/toolbar/MarkSelection.svelte b/frontend/src/lib/toolbar/MarkSelection.svelte
index 27eb2c7..1af36ca 100644
--- a/frontend/src/lib/toolbar/MarkSelection.svelte
+++ b/frontend/src/lib/toolbar/MarkSelection.svelte
@@ -1,24 +1,23 @@
 <script lang="ts">
 	import Dropdown from '$lib/components/Dropdown.svelte';
+	import type { Snippet } from 'svelte';
 
-	let visible = false;
-	let button: HTMLElement;
+	let { children }: { children: Snippet } = $props();
 </script>
 
-<div class="relative">
-	<button
-		type="button"
-		class="btn-slate rounded-inherit relative hover:bg-blue-700 [&:not(:only-child)]:bg-blue-700"
-		title="Set flag..."
-		bind:this={button}
-		on:click={() => (visible = !visible)}
-	>
-		<span class="icon-base icon-[material-symbols--flag] pointer-events-none" />
-	</button>
-
-	<Dropdown parent={button} bind:visible>
-		<div class="grid grid-cols-[min-content_min-content] gap-1">
-			<slot />
-		</div>
-	</Dropdown>
-</div>
+<Dropdown>
+	{#snippet button(onclick)}
+		<button
+			type="button"
+			class="btn-slate rounded-inherit relative hover:bg-blue-700 [&:not(:only-child)]:bg-blue-700"
+			title="Set flag..."
+			aria-label="Set flag..."
+			{onclick}
+		>
+			<span class="icon-base icon-[material-symbols--flag] pointer-events-none"></span>
+		</button>
+	{/snippet}
+	<div class="grid grid-cols-[min-content_min-content] gap-1">
+		{@render children?.()}
+	</div>
+</Dropdown>
-- 
cgit v1.2.3-2-gb3c3

