mirror of
https://github.com/ivabus/gui
synced 2025-04-23 14:07:14 +03:00
Merge pull request #205 from teaxyz/on-change-page-scroll-up
On change page scroll up
This commit is contained in:
commit
c001fcd913
1 changed files with 11 additions and 11 deletions
|
@ -1,7 +1,7 @@
|
|||
<script lang="ts">
|
||||
import '$appcss';
|
||||
// import { navigating } from '$app/stores';
|
||||
// import { afterNavigate } from '$app/navigation';
|
||||
import { navigating } from '$app/stores';
|
||||
import { afterNavigate } from '$app/navigation';
|
||||
import TopBar from '$components/TopBar/TopBar.svelte';
|
||||
import FooterLinks from '$components/FooterLinks/FooterLinks.svelte';
|
||||
import { navStore } from '$libs/stores';
|
||||
|
@ -10,15 +10,15 @@
|
|||
|
||||
let view: HTMLElement;
|
||||
|
||||
// $: if ($navigating) view.scrollTop = 0;
|
||||
$: if ($navigating) view.scrollTop = 0;
|
||||
|
||||
// afterNavigate(({ from, to }) => {
|
||||
// if (to && to?.route.id && from && from?.url) {
|
||||
// const nextPath = to.url.href.replace(to.url.origin, '');
|
||||
// const fromPath = from?.url.href.replace(from.url.origin, '');
|
||||
// navStore.setNewPath(nextPath, fromPath || '/');
|
||||
// }
|
||||
// });
|
||||
afterNavigate(({ from, to }) => {
|
||||
if (to && to?.route.id && from && from?.url) {
|
||||
const nextPath = to.url.href.replace(to.url.origin, '');
|
||||
const fromPath = from?.url.href.replace(from.url.origin, '');
|
||||
navStore.setNewPath(nextPath, fromPath || '/');
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<div id="main-layout" class="w-full">
|
||||
|
@ -31,7 +31,7 @@
|
|||
<footer class="border-gray mt-8 w-full border border-r-0 bg-black">
|
||||
<FooterLinks />
|
||||
</footer>
|
||||
<!-- <SearchPopupResults /> -->
|
||||
<SearchPopupResults />
|
||||
</section>
|
||||
</div>
|
||||
|
||||
|
|
Loading…
Reference in a new issue