forked from MapComplete/MapComplete
UX: show loading icon if images are being loaded
This commit is contained in:
parent
d7509c8d6f
commit
32993df92a
7 changed files with 97 additions and 57 deletions
|
@ -17,6 +17,7 @@
|
|||
import Translations from "../i18n/Translations"
|
||||
import Tr from "../Base/Tr.svelte"
|
||||
import DotMenu from "../Base/DotMenu.svelte"
|
||||
import LoadingPlaceholder from "../Base/LoadingPlaceholder.svelte"
|
||||
|
||||
export let image: Partial<ProvidedImage>
|
||||
let fallbackImage: string = undefined
|
||||
|
@ -111,7 +112,11 @@
|
|||
<slot name="dot-menu-actions" />
|
||||
</DotMenu>
|
||||
{/if}
|
||||
{#if !loaded}
|
||||
<LoadingPlaceholder />
|
||||
{/if}
|
||||
<img
|
||||
class:hidden={!loaded}
|
||||
bind:this={imgEl}
|
||||
on:load={() => (loaded = true)}
|
||||
class={imgClass ?? ""}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue