0
0
mirror of https://github.com/go-gitea/gitea.git synced 2026-04-12 07:46:31 +02:00

Update web_src/js/features/file-view.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: hamkido <hamki.do2000@gmail.com>
This commit is contained in:
hamkido 2026-01-26 17:18:37 +08:00 committed by GitHub
parent 860afc51d3
commit 5896a80421
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -77,7 +77,9 @@ function updateSidebarPosition(elFileView: HTMLElement, sidebar: HTMLElement): v
// Dynamically calculate max-height so sidebar doesn't extend below segment bottom
const availableHeight = Math.max(0, segmentRect.bottom - topPos);
const cssMaxHeight = window.innerHeight - 140; // Match CSS calc(100vh - 140px)
// 140px accounts for fixed layout chrome (header, spacing, etc.) and must match CSS: calc(100vh - 140px)
const cssMaxHeightOffset = 140;
const cssMaxHeight = window.innerHeight - cssMaxHeightOffset;
const maxHeight = Math.min(availableHeight, cssMaxHeight);
// Hide sidebar if available height is too small