| 1 |
/** |
| 2 |
* This script initialises the AsideWithButton.svelte component. |
| 3 |
*/ |
| 4 |
|
| 5 |
import { mount } from "svelte"; |
| 6 |
import { get as store_get } from "svelte/store"; |
| 7 |
|
| 8 |
import Modals from "../modals/Modals.svelte"; |
| 9 |
import { ledger_title } from "../stores"; |
| 10 |
import HeaderAndAside from "./HeaderAndAside.svelte"; |
| 11 |
import { page_title } from "./page-title"; |
| 12 |
|
| 13 |
export function initSidebar(): void { |
| 14 |
page_title.subscribe(({ title }) => { |
| 15 |
document.title = `${title} - ${store_get(ledger_title)}`; |
| 16 |
}); |
| 17 |
|
| 18 |
mount(HeaderAndAside, { |
| 19 |
target: document.body, |
| 20 |
anchor: document.querySelector("article") ?? undefined, |
| 21 |
}); |
| 22 |
|
| 23 |
mount(Modals, { |
| 24 |
target: document.body, |
| 25 |
}); |
| 26 |
} |