Skip to content

Commit

Permalink
feat: update html for non-image attachment
Browse files Browse the repository at this point in the history
Signed-off-by: Luka Trovic <[email protected]>
  • Loading branch information
luka-nextcloud committed Mar 14, 2023
1 parent 3b5fa1d commit f9fab12
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/nodes/ImageView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,15 @@
<transition name="fade">
<template v-if="!failed">
<div v-if="isMediaAttachment"
class="media"
@click="handleImageClick(src)">
class="media">
<div class="media__wrapper">
<img v-show="loaded"
:src="imageUrl"
class="image__main"
@load="onLoaded">
<a :href="internalLinkOrImage"
target="_blank">
<img v-show="loaded"
:src="imageUrl"
class="image__main"
@load="onLoaded">
</a>
<div class="metadata">
<span class="name">{{ alt }}</span>
<span class="size">{{ attachmentMetadata.size }}</span>
Expand Down Expand Up @@ -135,7 +137,7 @@ import { NcButton } from '@nextcloud/vue'
import ShowImageModal from '../components/ImageView/ShowImageModal.vue'
import store from './../mixins/store.js'
import { useAttachmentResolver } from './../components/Editor.provider.js'
import { mimetypesImages as IMAGE_MIMES } from '../helpers/mime.js'
import { mimetypesImages as IMAGE_MIMES, openMimetypes as MEDIA_MIMES } from '../helpers/mime.js'
import { generateUrl } from '@nextcloud/router'
import { NodeViewWrapper } from '@tiptap/vue-2'
import { logger } from '../helpers/logger.js'
Expand Down Expand Up @@ -226,7 +228,7 @@ export default {
},
isSupportedImage() {
return typeof this.mimeType === 'undefined'
|| IMAGE_MIMES.indexOf(this.mimeType) !== -1
|| [...IMAGE_MIMES, ...MEDIA_MIMES].indexOf(this.mimeType) !== -1
},
internalLinkOrImage() {
if (this.fileId) {
Expand Down

0 comments on commit f9fab12

Please sign in to comment.