mirror of
https://github.com/hcengineering/platform.git
synced 2024-11-23 14:06:00 +03:00
Open images in internal viewer
Signed-off-by: Andrey Platov <andrey@hardcoreeng.com>
This commit is contained in:
parent
15e365ec6e
commit
62edf2c29d
@ -32,16 +32,20 @@
|
||||
const ext = parts[parts.length - 1]
|
||||
return ext.substring(0, 4).toUpperCase()
|
||||
}
|
||||
|
||||
function openEmbedded(contentType: string) {
|
||||
return contentType.includes('application/pdf') || contentType.startsWith('image/')
|
||||
}
|
||||
</script>
|
||||
|
||||
<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>
|
||||
{:else}
|
||||
<a class="no-line" href={getFileUrl(value.file)} download={value.name}><div class="flex-center icon">{iconLabel(value.name)}</div></a>
|
||||
{/if}
|
||||
<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>
|
||||
{:else}
|
||||
<div class="name"><a href={getFileUrl(value.file)} download={value.name}>{trimFilename(value.name)}</a></div>
|
||||
|
Loading…
Reference in New Issue
Block a user