web/elements: add PageHeader element to replace page
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
@ -5,8 +5,7 @@ import { RouteMatch } from "./RouteMatch";
|
||||
import AKGlobal from "../../authentik.css";
|
||||
|
||||
import "./Router404";
|
||||
import { Page } from "../Page";
|
||||
import { ROUTE_SEPARATOR, TITLE_SUFFIX } from "../../constants";
|
||||
import { ROUTE_SEPARATOR } from "../../constants";
|
||||
|
||||
// Poliyfill for hashchange.newURL,
|
||||
// https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onhashchange
|
||||
@ -38,8 +37,6 @@ export class RouterOutlet extends LitElement {
|
||||
}
|
||||
*:first-child {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
`,
|
||||
];
|
||||
@ -54,18 +51,6 @@ export class RouterOutlet extends LitElement {
|
||||
this.navigate();
|
||||
}
|
||||
|
||||
updated(): void {
|
||||
if (!this.shadowRoot) return;
|
||||
Array.from(this.shadowRoot?.children).forEach((el) => {
|
||||
if ("pageTitle" in el) {
|
||||
const title = (el as Page).pageTitle();
|
||||
document.title = `${title} - ${TITLE_SUFFIX}`;
|
||||
} else {
|
||||
document.title = TITLE_SUFFIX;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
navigate(ev?: HashChangeEvent): void {
|
||||
let activeUrl = window.location.hash.slice(1, Infinity).split(ROUTE_SEPARATOR)[0];
|
||||
if (ev) {
|
||||
|
Reference in New Issue
Block a user