Skip to content

Commit

Permalink
Merge pull request #80 from Kaffe-diem/deeplink-fix
Browse files Browse the repository at this point in the history
on:click to onclick in /admin/+layout.svelte
  • Loading branch information
IldenH authored Dec 4, 2024
2 parents d0d2582 + 8c97a32 commit ce2c83c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/routes/admin/+layout.svelte
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
<script>
import { goto } from '$app/navigation';
import { goto } from "$app/navigation";
let { children } = $props();
const redirectToPrevious = () => {
const length = $state(window.location.pathname.split('/').length);
const length = $state(window.location.pathname.split("/").length);
let href = "";
for (let i = 0; i < length - 2; i++) {
href += '.';
href += ".";
}
href += '/';
href += "/";
goto(href);
}
};
</script>

<main class="relative mx-auto w-11/12 py-4">
{@render children?.()}
</main>

<div class="absolute bottom-0 right-0 m-8 hidden md:flex">
<a on:click={redirectToPrevious} class="btn btn-secondary">Tilbake</a>
<a onclick={redirectToPrevious} class="btn btn-secondary">Tilbake</a>
</div>

0 comments on commit ce2c83c

Please sign in to comment.