From aeccce0f89c1141f13d1f9498c87023d8e59e195 Mon Sep 17 00:00:00 2001 From: ReiMerc Date: Wed, 8 Feb 2023 12:05:36 +0100 Subject: [PATCH] Small fixes --- frontend/src/main.ts | 2 +- frontend/src/topbar.ts | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/frontend/src/main.ts b/frontend/src/main.ts index 95a2fc6..930a32b 100644 --- a/frontend/src/main.ts +++ b/frontend/src/main.ts @@ -17,7 +17,7 @@ async function fetchZipCode({ latitude, }: Coordinate): Promise { 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) => { diff --git a/frontend/src/topbar.ts b/frontend/src/topbar.ts index 90a60f7..f6754af 100644 --- a/frontend/src/topbar.ts +++ b/frontend/src/topbar.ts @@ -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"); });