Browse Source

Display a "Load More" button if load-on-scroll fails

master
buttercat1791 10 months ago
parent
commit
f72adcb6d3
  1. 14
      src/lib/components/Publication.svelte

14
src/lib/components/Publication.svelte

@ -167,8 +167,8 @@
</script> </script>
<!-- TODO: Keep track of already-loaded leaves. --> <!-- TODO: Keep track of already-loaded leaves. -->
<!-- TODO: Determine when we've reached the end of the document. -->
<!-- TODO: Handle entering mid-document and scrolling up. --> <!-- TODO: Handle entering mid-document and scrolling up. -->
<!-- TODO: Make loading more gradual. -->
{#if showTocButton && !showToc} {#if showTocButton && !showToc}
<!-- <Button <!-- <Button
@ -215,6 +215,18 @@
/> />
{/if} {/if}
{/each} {/each}
<!-- TODO: Hide the button if there are no more leaves to load. -->
<div class="flex justify-center my-4">
{#if isLoading}
<Button disabled color="primary">
Loading...
</Button>
{:else}
<Button color="primary" on:click={() => loadMore(1)}>
Show More
</Button>
{/if}
</div>
</div> </div>
<style> <style>

Loading…
Cancel
Save