From ee2c1fde94cd1ad80cad273ada88f0d840596418 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Ml=C3=A1dek?= Date: Sun, 23 Apr 2023 22:57:52 +0200 Subject: [PATCH] fix, wip: don't show preview for non-image fragments --- .../display/blobs/FragmentViewer.svelte | 29 ++++++++++++------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/webui/src/components/display/blobs/FragmentViewer.svelte b/webui/src/components/display/blobs/FragmentViewer.svelte index 8ef5b10..016d0c9 100644 --- a/webui/src/components/display/blobs/FragmentViewer.svelte +++ b/webui/src/components/display/blobs/FragmentViewer.svelte @@ -12,8 +12,13 @@ $: objectAddress = String($entity?.get("ANNOTATES") || ""); + $: imageFragment = ["x=", "y=", "w=", "h="].every((q) => + String($entity?.get("W3C_FRAGMENT_SELECTOR")).includes(q) + ); + let imageLoaded = false; $: imageLoaded && dispatch("loaded"); + $: if ($entity && !imageFragment) imageLoaded = true;
@@ -21,17 +26,19 @@ {/if} {#if $entity} - {address} (imageLoaded = true)} - draggable="false" - /> + {#if imageFragment} + {address} (imageLoaded = true)} + draggable="false" + /> + {/if} {/if}