Small fixes

This commit is contained in:
ReiMerc 2023-02-08 12:05:36 +01:00
parent 45bc0bfd2f
commit 20acff066b
2 changed files with 5 additions and 6 deletions

View File

@ -17,7 +17,7 @@ async function fetchZipCode({
latitude,
}: Coordinate): Promise<ZipCodeReverseResponse> {
return fetch(
`https://api.dataforsyningen.dk/postnumre/reverse?x=${longitude}&y=${latitude}`,
`https://api.dataforsyningen.dk/postnumre/reverse?x=${longitude}&y=${latitude}&landpostnumre`,
)
.then((request) => request.json())
.then((data) => {

View File

@ -1,14 +1,13 @@
// handles automatically sizing the topbar
export function setTopbarOffset() {
const height = document.getElementById("topbar").getBoundingClientRect().height;
document.querySelector(":root").style = `--topbar-offset: ${height}px;`
const height = document.getElementById("topbar")!.getBoundingClientRect().height;
document.querySelector(":root")!.style = `--topbar-offset: ${height}px;`
}
export function addToggleDropdownListener() {
const element = document.getElementById("dropdown-button");
const dropdown = document.getElementById("dropdown");
console.log("?");
const element = document.getElementById("dropdown-button")!;
const dropdown = document.getElementById("dropdown")!;
element.addEventListener("click", () => {
dropdown.classList.toggle("enabled");
});