-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #80 from Kaffe-diem/deeplink-fix
on:click to onclick in /admin/+layout.svelte
- Loading branch information
Showing
1 changed file
with
6 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |