0
0
mirror of https://github.com/go-gitea/gitea.git synced 2026-04-11 05:55:00 +02:00

fix(file-view): specify HTMLElement type in closest method for improved type safety

This commit is contained in:
hamki 2026-02-03 07:17:14 +08:00
parent 61933a9668
commit 81f930e671

View File

@ -108,7 +108,7 @@ function initSidebarToggle(elFileView: HTMLElement): void {
if (!toggleBtn || !sidebar) return;
// Check if we're in file view (not home page) - only file view needs margin adjustment
const repoViewContent = elFileView.closest('.repo-view-content');
const repoViewContent = elFileView.closest<HTMLElement>('.repo-view-content');
const isFileView = Boolean(repoViewContent);
// Helper to update position