fix: enable scrolling for episode list with fixed height

This commit is contained in:
2026-05-08 13:21:21 +02:00
parent 223089fa61
commit df2bf8125d

View File

@@ -7,8 +7,8 @@
{{if or (not $currentEpID) (eq (printf "%v" $currentEpID) "0") (eq (printf "%v" $currentEpID) "")}}{{$currentEpID = "1"}}{{end}}
{{$totalEpisodes := len $episodes}}
<div id="watch-layout" class="flex flex-col gap-6 pb-12 lg:flex-row lg:gap-6">
<div class="flex-1 min-w-0">
<div id="watch-layout" class="flex flex-col gap-6 pb-12 lg:flex-row lg:gap-6{{if le $totalEpisodes 100}} max-h-dvh{{end}}">
<div class="{{if le $totalEpisodes 100}}shrink-0 lg:flex-1 lg:self-start{{else}}flex-1{{end}} min-w-0">
<div class="flex items-center justify-between mb-4">
<a href="/anime/{{$anime.MalID}}" class="inline-flex items-center gap-2 text-sm text-foreground-muted hover:text-foreground transition-colors">
<svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 19l-7-7m0 0l7-7m-7 7h18" /></svg>
@@ -86,7 +86,7 @@
</div>
</div>
<div class="w-full lg:w-80 xl:w-96 shrink-0">
<div class="w-full lg:w-80 xl:w-96{{if le $totalEpisodes 100}} flex flex-col min-h-0 flex-1 lg:flex-none lg:shrink-0 lg:sticky lg:top-24 lg:self-start lg:h-[calc(100dvh-5rem)] lg:overflow-y-auto lg:pb-4{{else}} shrink-0{{end}}">
{{if .Seasons}}
{{$currentSeason := dict "Prefix" "" "Title" $anime.Title}}
{{range .Seasons}}
@@ -121,7 +121,7 @@
<p class="text-sm">No episodes found</p>
</div>
{{else}}
<div class="flex flex-col gap-2">
<div class="flex flex-col gap-2 shrink-0">
<div class="flex items-center justify-between">
<span class="text-sm font-normal text-foreground-muted">Episodes</span>
{{if gt $totalEpisodes 100}}
@@ -165,7 +165,7 @@
{{end}}
</div>
{{else}}
<div class="flex flex-col gap-1 overflow-y-auto max-h-[70vh] lg:max-h-[calc(100vh-8rem)] pr-2 scrollbar-hide mt-2" data-episode-list>
<div class="flex min-h-0 flex-1 flex-col gap-1 pr-2 pb-4 scrollbar-hide mt-2 overflow-y-auto" data-episode-list style="overscroll-behavior-y: contain">
{{range $episodes}}
{{$isCurrent := eq (printf "%v" .MalID) $currentEpID}}
{{$isFiller := .Filler}}
@@ -236,6 +236,8 @@
}
});
}
</script>
</div>
</div>