Skip to content

Commit

Permalink
fix(editor): Render image binary-data using img tags (#10829)
Browse files Browse the repository at this point in the history
Co-authored-by: Milorad Filipovic <[email protected]>
  • Loading branch information
netroy and MiloradFilipovic authored Sep 16, 2024
1 parent 25c8a32 commit 7c23101
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions packages/editor-ui/src/components/BinaryDataDisplayEmbed.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ onMounted(async () => {
<source :src="embedSource" :type="binaryData.mimeType" />
{{ $locale.baseText('binaryDataDisplay.yourBrowserDoesNotSupport') }}
</audio>
<img v-else-if="binaryData.fileType === 'image'" :src="embedSource" />
<VueJsonPretty
v-else-if="binaryData.fileType === 'json'"
:data="data"
Expand All @@ -76,18 +77,16 @@ onMounted(async () => {
</template>

<style lang="scss">
img,
video {
max-height: 100%;
max-width: 100%;
}
.binary-data {
background-color: var(--color-foreground-xlight);
&.image {
max-height: calc(100% - 1em);
max-width: calc(100% - 1em);
}
&.other,
&.pdf {
height: calc(100% - 1em);
width: calc(100% - 1em);
height: 100%;
width: 100%;
}
}
</style>

0 comments on commit 7c23101

Please sign in to comment.