Small fixes

This commit is contained in:
ReiMerc 2023-02-08 12:05:36 +01:00 committed by SimonFJ20
parent 9e6b9e7c27
commit aeccce0f89
2 changed files with 5 additions and 6 deletions

View File

@ -17,7 +17,7 @@ async function fetchZipCode({
latitude, latitude,
}: Coordinate): Promise<ZipCodeReverseResponse> { }: Coordinate): Promise<ZipCodeReverseResponse> {
return fetch( 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((request) => request.json())
.then((data) => { .then((data) => {

View File

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