mirror of
https://github.com/go-gitea/gitea.git
synced 2026-05-10 09:41:52 +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:
parent
5896a80421
commit
24f253fe44
@ -132,8 +132,13 @@ function initSidebarToggle(elFileView: HTMLElement): void {
|
||||
// For file view, first add margin, wait for layout, then show sidebar
|
||||
if (isFileView && repoViewContent) {
|
||||
repoViewContent.classList.add('sidebar-visible');
|
||||
// Wait for CSS transition to complete (200ms) before calculating position
|
||||
setTimeout(showAfterLayout, 220);
|
||||
// Wait for CSS transition to actually complete before calculating position
|
||||
const onTransitionEnd = (event: TransitionEvent) => {
|
||||
if (event.target !== repoViewContent) return;
|
||||
repoViewContent.removeEventListener('transitionend', onTransitionEnd);
|
||||
showAfterLayout();
|
||||
};
|
||||
repoViewContent.addEventListener('transitionend', onTransitionEnd);
|
||||
} else {
|
||||
// For home page (README), no margin needed, show with small delay
|
||||
setTimeout(showAfterLayout, 10);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user