From 13e5974114f759bae73f3bfd68c62ce9cfaf785e Mon Sep 17 00:00:00 2001
From: mat <github@matdoes.dev>
Date: Sun, 20 Feb 2022 21:38:14 -0600
Subject: add more stuff to profile and fix bugs

---
 src/lib/minecraft/MinecraftTooltip.svelte | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

(limited to 'src/lib/minecraft/MinecraftTooltip.svelte')

diff --git a/src/lib/minecraft/MinecraftTooltip.svelte b/src/lib/minecraft/MinecraftTooltip.svelte
index 9c4e274..ae68f8b 100644
--- a/src/lib/minecraft/MinecraftTooltip.svelte
+++ b/src/lib/minecraft/MinecraftTooltip.svelte
@@ -3,15 +3,23 @@
 
     A tooltip that looks like when you hover over a Minecraft item in an inventory. This requires JavaScript.
  -->
+<script lang="ts">
+	import { registerItem } from '$lib/GlobalTooltip'
+	import { onMount } from 'svelte'
 
-<span class="minecraft-tooltip">
+	let el
+
+	onMount(() => {
+		registerItem(el)
+	})
+</script>
+
+<span class="minecraft-tooltip" bind:this={el}>
 	<span class="tooltip-name">
 		<slot name="name" />
-	</span>
-	<span class="tooltip-lore">
+	</span><span class="tooltip-lore">
 		<slot name="lore" />
-	</span>
-	<slot />
+	</span><slot />
 </span>
 
 <style>
-- 
cgit 

