Auto-maximize attached files on open (#9472)

Signed-off-by: Alexander Platov <alexander.platov@hardcoreeng.com>
This commit is contained in:
Alexander Platov
2025-07-05 11:33:21 +07:00
committed by GitHub
parent 8b5bfc35d1
commit 89d8a6fd03
7 changed files with 61 additions and 13 deletions
@@ -69,7 +69,7 @@
showTooltip={{ label: attachment.string.OpenInWindow }}
on:click={() => {
closeTooltip()
showPopup(FilePreviewPopup, { file, name: fileName, contentType, metadata }, 'centered')
showPopup(FilePreviewPopup, { file, name: fileName, contentType, metadata, fullSize: true }, 'centered')
}}
/>
</svelte:fragment>
+5 -2
View File
@@ -155,9 +155,12 @@ export function isAttachment (value: Attachment | BlobType): value is WithLookup
return (value as Attachment)._id !== undefined
}
export function showAttachmentPreviewPopup (value: WithLookup<Attachment> | BlobType): PopupResult {
export function showAttachmentPreviewPopup (
value: WithLookup<Attachment> | BlobType,
fullSize: boolean = true
): PopupResult {
closeTooltip()
return showPopup(AttachmentPreviewPopup, { value }, getPreviewAlignment(value.type ?? ''))
return showPopup(AttachmentPreviewPopup, { value, fullSize }, getPreviewAlignment(value.type ?? ''))
}
interface ImageDimensions {