diff --git a/frontend/src/lib/components/DocumentBottomPanel.svelte b/frontend/src/lib/components/DocumentBottomPanel.svelte index c3e509ca..cb2dbc02 100644 --- a/frontend/src/lib/components/DocumentBottomPanel.svelte +++ b/frontend/src/lib/components/DocumentBottomPanel.svelte @@ -75,7 +75,7 @@ let dragStartHeight = 0; function fullHeight() { const topbar = document.querySelector('[data-topbar]'); - return window.innerHeight - (topbar?.getBoundingClientRect().height ?? 0); + return window.innerHeight - (topbar?.getBoundingClientRect().bottom ?? 0); } function openTab(tab: Tab) { diff --git a/frontend/src/routes/documents/[id]/+page.svelte b/frontend/src/routes/documents/[id]/+page.svelte index f0c39298..1e76b93c 100644 --- a/frontend/src/routes/documents/[id]/+page.svelte +++ b/frontend/src/routes/documents/[id]/+page.svelte @@ -78,11 +78,14 @@ const LS_KEY_HEIGHT = 'doc-panel-height'; const LS_KEY_TAB = 'doc-panel-tab'; let panelOpen = $state(false); -let panelHeight = $state(0); // set to 80vh on mount +let panelHeight = $state(0); // set to full height on mount +let navHeight = $state(0); let activeTab = $state('metadata'); let localStorageRestored = $state(false); onMount(() => { + navHeight = document.querySelector('header')?.getBoundingClientRect().height ?? 0; + const savedOpen = localStorage.getItem(LS_KEY_OPEN); const savedHeight = localStorage.getItem(LS_KEY_HEIGHT); const savedTab = localStorage.getItem(LS_KEY_TAB); @@ -91,7 +94,7 @@ onMount(() => { activeTab = savedTab as Tab; } const topbar = document.querySelector('[data-topbar]'); - panelHeight = window.innerHeight - (topbar?.getBoundingClientRect().height ?? 0); + panelHeight = window.innerHeight - navHeight - (topbar?.getBoundingClientRect().height ?? 0); if (savedHeight) { const h = parseInt(savedHeight, 10); if (!isNaN(h) && h >= 80) panelHeight = h; @@ -133,7 +136,11 @@ $effect(() => { {doc.title || doc.originalFilename || 'Dokument'} -
+