fix, wip: don't show preview for non-image fragments
This commit is contained in:
parent
ddb7af116b
commit
ee2c1fde94
1 changed files with 18 additions and 11 deletions
|
@ -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;
|
||||
</script>
|
||||
|
||||
<div class="fragment-viewer">
|
||||
|
@ -21,6 +26,7 @@
|
|||
<Spinner />
|
||||
{/if}
|
||||
{#if $entity}
|
||||
{#if imageFragment}
|
||||
<img
|
||||
class="preview-image"
|
||||
class:imageLoaded
|
||||
|
@ -33,6 +39,7 @@
|
|||
draggable="false"
|
||||
/>
|
||||
{/if}
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<style lang="scss">
|
||||
|
|
Loading…
Reference in a new issue