diff --git a/src/routes/repo/[projectId]/accordion.ts b/src/routes/repo/[projectId]/accordion.ts index b28bdbc1f..f30d883cc 100644 --- a/src/routes/repo/[projectId]/accordion.ts +++ b/src/routes/repo/[projectId]/accordion.ts @@ -1,29 +1,9 @@ export function accordion(node: HTMLDivElement, isOpen: boolean) { - const initialHeight = node.offsetHeight; node.style.height = isOpen ? 'auto' : '0'; node.style.overflow = 'hidden'; return { update(isOpenInner: boolean) { - const animation = node.animate( - [ - { - height: initialHeight + 'px', - overflow: 'visible' - }, - { - height: 0, - overflow: 'hidden' - } - ], - { duration: 100, fill: 'both' } - ); - animation.pause(); - if (!isOpenInner) { - animation.play(); - } else { - animation.reverse(); - animation.play(); - } + node.style.display = isOpenInner ? 'initial' : 'none'; } }; }