Move search bar into modal
This commit is contained in:
@@ -11,6 +11,7 @@ import Appearance from "pages/Appearance.svelte";
|
||||
import Footer from "layout/Footer.svelte";
|
||||
import { current_page_store, type Tab } from "./RouterStore";
|
||||
import { get_user, type User } from "lib/PixeldrainAPI";
|
||||
import { breadcrumbs_store } from "./BreadcrumbStore";
|
||||
|
||||
let pages: Tab[] = [
|
||||
{
|
||||
@@ -37,6 +38,7 @@ let pages: Tab[] = [
|
||||
title: "Filesystem",
|
||||
component: Filesystem,
|
||||
footer: false,
|
||||
custom_breadcrumbs: true,
|
||||
}, {
|
||||
path: "/admin",
|
||||
prefix: "/admin/",
|
||||
@@ -107,6 +109,10 @@ const load_page = (pathname: string, history: boolean): boolean => {
|
||||
window.history.pushState({}, window.document.title, pathname)
|
||||
}
|
||||
|
||||
if (current_page.custom_breadcrumbs !== true) {
|
||||
breadcrumbs_store.set(breadcrumbs)
|
||||
}
|
||||
|
||||
// The current_page_store updates all the listening pages for navigation
|
||||
// events. We first wait for a tick so that the current page gets unmounted
|
||||
// before sending the event. That way a stale page will not get events which
|
||||
@@ -144,6 +150,10 @@ const popstate = (e: PopStateEvent) => {
|
||||
}
|
||||
</script>
|
||||
|
||||
{#snippet breadcrumbs()}
|
||||
{current_page.title}
|
||||
{/snippet}
|
||||
|
||||
<svelte:document onclick={click}/>
|
||||
<svelte:window onpopstate={popstate}/>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user