Kleinere Anpassungen für Seiten- und Navigations- Bearbeitung.

This commit is contained in:
2022-05-30 15:57:11 +02:00
parent c67f712280
commit 5d08a96327
11 changed files with 32 additions and 23 deletions

View File

@@ -14,13 +14,9 @@
}
const setLanguage = (lang: string) => {
let path = $location.path.split("/")
path[1] = lang
$location.path = path.join("/")
$currentLang = lang
navigate($location.path + $location.search, { replace: true })
// $location.path = "/" + lang
// navigate($location.path + $location.search, { replace: true })
}
</script>

View File

@@ -4,7 +4,7 @@
import { mdiMenu } from "@mdi/js"
import { links } from "svelte-routing"
import { navigations, currentLang } from "../../store"
import { navigations, currentLang, location } from "../../store"
import LanguageChooser from "./LanguageChooser.svelte"
@@ -40,7 +40,7 @@
{item.settings.title}
</a>
{:else}
<a href="/{navigation.locale}{item.settings.page}">
<a href="{item.settings.page}" class:active="{item.settings.page === $location.path}">
{item.settings.title}
</a>
{/if}
@@ -69,7 +69,11 @@
</div>
{:else}
<div class="nav-item">
<a href="/{navigation.locale}{item.settings.page}" on:click="{() => (showMobileNav = false)}">
<a
href="{item.settings.page}"
on:click="{() => (showMobileNav = false)}"
class:active="{item.settings.page === $location.path}"
>
{item.settings.title}
</a>
</div>