diff --git a/CHANGELOG.md b/CHANGELOG.md index 2052a734..c2cf2156 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,3 +8,4 @@ - Updated to Sveltekit 1.11 - Uupdated to Vitest 0.29.2 - Corrected positioning of marginals in callouts, quotes, and other blocks [#323](#323) +- Fixed laggy udpates of chapter cover images diff --git a/src/lib/components/page/Header.svelte b/src/lib/components/page/Header.svelte index 4f698044..7da2435c 100644 --- a/src/lib/components/page/Header.svelte +++ b/src/lib/components/page/Header.svelte @@ -61,80 +61,84 @@ $: embed = getImage(); -
- {#if embed} -
- {#if $edition && editable} - Parser.parseEmbed($edition, text)} - save={(node) => - setImage ? setImage(node.toBookdown()) : undefined} - chapter={false} - component={Embed} - placeholder="" - leasee={getLeasee(auth, edition, `embed-${id}`)} - lease={(lock) => lease(auth, edition, `embed-${id}`, lock)} - /> - {:else} - - {/if} - {#if !print && showReminder} -
- {/if} -
- {:else} - -

 

- {/if} - {#if !print} - - {/if} - {#if editable} - {#if embed === null} - + +{#key id} +
+ {#if embed} +
+ {#if $edition && editable} + Parser.parseEmbed($edition, text)} + save={(node) => + setImage ? setImage(node.toBookdown()) : undefined} + chapter={false} + component={Embed} + placeholder="" + leasee={getLeasee(auth, edition, `embed-${id}`)} + lease={(lock) => + lease(auth, edition, `embed-${id}`, lock)} + /> + {:else} + + {/if} + {#if !print && showReminder} +
+ {/if} +
{:else} - - cover image + +

 

{/if} - {/if} -
- - - {#if editable && save} - <TextEditor - {label} - text={header + (subtitle ? ': ' + subtitle : '')} - placeholder="title" - valid={(text) => - text.length === 0 - ? 'Titles have to be at least one character long.' - : undefined} - {save} - /> + {#if !print} + <slot name="outline" /> + {/if} + {#if editable} + {#if embed === null} + <Button tooltip="add cover image" command={addCover} + >+ cover image</Button + > {:else} - {header} - {#if subtitle}<div class="bookish-subtitle">{subtitle}</div - >{/if} + <ConfirmButton + confirm="delete image" + tooltip="delete cover image" + command={removeCover}>- cover image</ConfirmButton + > {/if} - - - {#if tags} -
{#each tags as tag}{tag}{/each}
{/if} -
-
+
+ + + {#if editable && save} + <TextEditor + {label} + text={header + (subtitle ? ': ' + subtitle : '')} + placeholder="title" + valid={(text) => + text.length === 0 + ? 'Titles have to be at least one character long.' + : undefined} + {save} + /> + {:else} + {header} + {#if subtitle}<div class="bookish-subtitle">{subtitle}</div + >{/if} + {/if} + + + {#if tags} +
{#each tags as tag}{tag}{/each}
+ {/if} +
+
+{/key}