mirror of
https://github.com/hcengineering/platform.git
synced 2025-01-26 21:34:27 +00:00
Merge pull request #355 from hcengineering/images2
Open images in internal viewer
This commit is contained in:
commit
2c738eb62a
@ -32,16 +32,20 @@
|
|||||||
const ext = parts[parts.length - 1]
|
const ext = parts[parts.length - 1]
|
||||||
return ext.substring(0, 4).toUpperCase()
|
return ext.substring(0, 4).toUpperCase()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function openEmbedded(contentType: string) {
|
||||||
|
return contentType.includes('application/pdf') || contentType.startsWith('image/')
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="flex-row-center">
|
<div class="flex-row-center">
|
||||||
{#if value.type.includes('application/pdf')}
|
{#if openEmbedded(value.type)}
|
||||||
<div class="flex-center icon" on:click={()=> { closeTooltip(); showPopup(PDFViewer, { file: value.file }, 'right') }}>{iconLabel(value.name)}</div>
|
<div class="flex-center icon" on:click={()=> { closeTooltip(); showPopup(PDFViewer, { file: value.file }, 'right') }}>{iconLabel(value.name)}</div>
|
||||||
{:else}
|
{:else}
|
||||||
<a class="no-line" href={getFileUrl(value.file)} download={value.name}><div class="flex-center icon">{iconLabel(value.name)}</div></a>
|
<a class="no-line" href={getFileUrl(value.file)} download={value.name}><div class="flex-center icon">{iconLabel(value.name)}</div></a>
|
||||||
{/if}
|
{/if}
|
||||||
<div class="flex-col info">
|
<div class="flex-col info">
|
||||||
{#if value.type.includes('application/pdf') || value.type.startsWith('image/')}
|
{#if openEmbedded(value.type)}
|
||||||
<div class="name" on:click={()=> { closeTooltip(); showPopup(PDFViewer, { file: value.file }, 'right') }}>{trimFilename(value.name)}</div>
|
<div class="name" on:click={()=> { closeTooltip(); showPopup(PDFViewer, { file: value.file }, 'right') }}>{trimFilename(value.name)}</div>
|
||||||
{:else}
|
{:else}
|
||||||
<div class="name"><a href={getFileUrl(value.file)} download={value.name}>{trimFilename(value.name)}</a></div>
|
<div class="name"><a href={getFileUrl(value.file)} download={value.name}>{trimFilename(value.name)}</a></div>
|
||||||
|
Loading…
Reference in New Issue
Block a user