add pdf and html framing in creations
This commit is contained in:
@@ -34,6 +34,10 @@ fragment NodePartial on MapItemInterface {
|
|||||||
url,
|
url,
|
||||||
title
|
title
|
||||||
}
|
}
|
||||||
|
files: fichiers {
|
||||||
|
filemime
|
||||||
|
url
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# For debug
|
# For debug
|
||||||
|
|||||||
@@ -44,14 +44,18 @@
|
|||||||
|
|
||||||
|
|
||||||
<b-modal
|
<b-modal
|
||||||
v-if="creation && creation.piece.url"
|
v-if="creation && creation.iframeUrl"
|
||||||
:id="'modal-creation' + creation.id"
|
:id="'modal-creation' + creation.id"
|
||||||
class="modal-creation"
|
class="modal-creation"
|
||||||
static hide-footer hide-header
|
static hide-footer hide-header
|
||||||
>
|
>
|
||||||
<template #default="{ hide }">
|
<template #default="{ hide, visible }">
|
||||||
<button-expand expanded @click="hide()" />
|
<button-expand expanded @click="hide()" />
|
||||||
<iframe :src="creation.piece.url" width="100%" height="100%" />
|
<iframe
|
||||||
|
v-if="visible"
|
||||||
|
:src="creation.iframeUrl"
|
||||||
|
width="100%" height="100%"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
</b-modal>
|
</b-modal>
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<div class="node-view-img-wrapper">
|
<div class="node-view-img-wrapper">
|
||||||
<img :src="node.image.url" :alt="node.image.alt">
|
<img :src="node.image.url" :alt="node.image.alt">
|
||||||
|
|
||||||
<button-expand v-if="node.piece.url" v-b-modal="'modal-creation' + node.id" class="center" />
|
<button-expand v-if="node.iframeUrl" v-b-modal="'modal-creation' + node.id" class="center" />
|
||||||
|
|
||||||
<div class="btns-artwork">
|
<div class="btns-artwork">
|
||||||
<b-button variant="depart" class="btn-shadow btn-artwork mr-2" @click="$emit('view-origin')">
|
<b-button variant="depart" class="btn-shadow btn-artwork mr-2" @click="$emit('view-origin')">
|
||||||
|
|||||||
@@ -40,6 +40,19 @@ export default {
|
|||||||
|
|
||||||
if (node.type === 'Creation') {
|
if (node.type === 'Creation') {
|
||||||
node.variant = [{ id: 0 }]
|
node.variant = [{ id: 0 }]
|
||||||
|
if (node.files && node.files.length) {
|
||||||
|
const mime = node.files[0].filemime
|
||||||
|
if (mime === 'application/pdf') {
|
||||||
|
node.iframeUrl = node.files[0].url + '#toolbar=0&navpanes=0&statusbar=0'
|
||||||
|
} else if (mime === 'text/html') {
|
||||||
|
node.iframeUrl = node.files[0].url
|
||||||
|
} else if (node.piece && node.piece.url) {
|
||||||
|
node.iframeUrl = node.piece.url
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (node.piece && node.piece.url) {
|
||||||
|
node.iframeUrl = node.piece.url
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (node.date) {
|
if (node.date) {
|
||||||
|
|||||||
Reference in New Issue
Block a user