Merge pull request #37 from reuters-graphics/stack-background-preload-fix

This commit is contained in:
Manas Sharma 2022-10-31 18:16:35 +05:30 committed by GitHub
commit 2d8e98d3c3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -9,7 +9,8 @@
{#each steps as step, i}
<!-- Load the step(s) before and after the active one, only -->
{#if preload === 0 || (i >= index - preload && i <= index + preload)}
<!-- Unless stackBackground is true. If so, keep all steps before the current one loaded. -->
{#if preload === 0 || (i >= (stackBackground ? 0 : index - preload) && i <= index + preload)}
<div
class="step-background step-{i + 1}"
class:visible="{stackBackground ? i <= index : i === index}"