A11y: reset zoom (chromium-browsers only) when getting back to the map or when opening a picture

This commit is contained in:
Pieter Vander Vennet 2024-01-11 04:00:56 +01:00
parent 41e7108b2e
commit 9655f8a092
10 changed files with 145 additions and 21 deletions

View file

@ -5,12 +5,16 @@
import panzoom from "panzoom"
import type { ProvidedImage } from "../../Logic/ImageProviders/ImageProvider"
import { UIEventSource } from "../../Logic/UIEventSource"
import Zoomcontrol from "../Zoomcontrol"
import { onDestroy, onMount } from "svelte"
export let image: ProvidedImage
let panzoomInstance = undefined
let panzoomEl: HTMLElement
export let isLoaded: UIEventSource<boolean> = undefined
onDestroy(Zoomcontrol.createLock())
$: {
if (panzoomEl) {
panzoomInstance = panzoom(panzoomEl, {