diff --git a/src/components/window.svelte b/src/components/window.svelte
index 7420b24..25767bf 100644
--- a/src/components/window.svelte
+++ b/src/components/window.svelte
@@ -25,18 +25,23 @@
const isOnMobile = isMobile()
const _draggable = isOnMobile ? () => {} : draggable;
+
+ const focusWindow = (node: HTMLElement) => {
+ $highestZIndex += 1
+ node.style.zIndex = $highestZIndex.toString()
+ }
+
+
{
- $highestZIndex += 1
- data.currentNode.style.zIndex = $highestZIndex.toString()
- },
+ onDragStart: (data) => {focusWindow(data.currentNode)},
}}
+ on:click={(data) => {focusWindow(data.currentTarget)}}
class="
relative flex flex-col {sticky ? 'md:sticky md:-top-9' : ''} {center ? "mx-auto" : ""}
max-w-screen-md xl:max-w-screen-lg 2xl:max-w-screen-xl min-w-[30ch] lg:min-w-[40ch] w-full md:w-fit [height:fit-content]