Commit 0074e441 authored by Anton's avatar Anton

Add link to Image cell

parent 50fe32b8
......@@ -104,6 +104,16 @@
errorMessage: 'Needs to be a valid URL',
value: '',
path: 'content'
},
{
inputType: 'url',
type: 'Image',
label: 'Link URL',
help: 'Insert any valid URL',
error: false,
errorMessage: 'Needs to be a valid URL',
value: '',
path: 'link'
}],
'Internal-Link': [{
inputType: 'url',
......
......@@ -68,14 +68,18 @@
}
return iconName
},
getSimpleType (mimetype) {
if (mimetype.indexOf('/') !== -1) return mimetype.split('/')[0]
return mimetype
getSimpleType (mimetype, capitalize = false) {
let type = mimetype
if (mimetype.indexOf('/') !== -1) type = mimetype.split('/')[0]
if (capitalize) {
type = type.substr(0, 1).toUpperCase() + type.substr(1)
}
return type
},
handleItemDragStart (event, item) {
const resourceCell = {
uuid: null,
type: this.getSimpleType(item.metaData['content-type']),
type: this.getSimpleType(item.metaData['content-type'], true),
x: 1,
y: 1,
width: 1,
......
......@@ -2,7 +2,9 @@
div(:class="{'display-preview': preview, 'display-full': display}")
template(v-if="display")
img(:src="imgSrc")
a(v-if="link", :href="link")
img(:src="imgSrc")
img(v-else, :src="imgSrc")
template(v-else)
div.cell-background(:style="cellBackgroundStyle")
......@@ -37,6 +39,10 @@
}
}
return src
},
link () {
if (!this.cell) return
return this.cell.link
}
},
mounted () {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment