mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-10 17:36:33 +08:00
Fix large asset preview [SCI-8433] (#5408)
This commit is contained in:
parent
57d736cbe4
commit
d8945cc627
2 changed files with 2 additions and 2 deletions
|
@ -51,7 +51,7 @@
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="attachment.attributes.pdf_previewable">
|
<template v-else-if="attachment.attributes.pdf_previewable && attachment.attributes.pdf !== null">
|
||||||
<PdfViewer :pdf="attachment.attributes.pdf" />
|
<PdfViewer :pdf="attachment.attributes.pdf" />
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="attachment.attributes.large_preview !== null">
|
<template v-else-if="attachment.attributes.large_preview !== null">
|
||||||
|
|
|
@ -79,7 +79,7 @@ class AssetSerializer < ActiveModel::Serializer
|
||||||
{
|
{
|
||||||
url: object.pdf? ? asset_download_path(object) : asset_pdf_preview_path(object),
|
url: object.pdf? ? asset_download_path(object) : asset_pdf_preview_path(object),
|
||||||
size: !object.pdf? && object.pdf_preview_ready? ? object.file_pdf_preview&.blob&.byte_size : object.file_size,
|
size: !object.pdf? && object.pdf_preview_ready? ? object.file_pdf_preview&.blob&.byte_size : object.file_size,
|
||||||
worker_url: asset_path('pdf_js_worker.js')
|
worker_url: ActionController::Base.helpers.asset_path('pdf_js_worker.js')
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue