mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-01 04:32:16 +08:00
Enable image preview for newly uploaded images [SCI-694]
This commit is contained in:
parent
aa2b573278
commit
89710d8782
2 changed files with 5 additions and 1 deletions
|
@ -26,9 +26,12 @@ function setupAssetsLoading() {
|
|||
|
||||
if (data.type === "image") {
|
||||
$el.html(
|
||||
"<a class='image-preview-link' id='modal_link" +
|
||||
data['asset-id'] + "' data-status='asset-present' " +
|
||||
"href='" + data['download-url'] + "'>" +
|
||||
"<img src='" + data['image-tag-url'] + "' data-preview-url='" +
|
||||
data['preview-url'] + "'><p>" +
|
||||
data.filename + "</p>"
|
||||
data.filename + '</p></a>'
|
||||
);
|
||||
} else {
|
||||
$el.html(
|
||||
|
|
|
@ -19,6 +19,7 @@ class AssetsController < ApplicationController
|
|||
|
||||
# If check permission passes, return :ok
|
||||
render json: {
|
||||
'asset-id' => @asset.id,
|
||||
'image-tag-url' => @asset.url(:medium),
|
||||
'preview-url' => large_image_url_asset_path(@asset),
|
||||
'filename' => truncate(@asset.file_file_name,
|
||||
|
|
Loading…
Reference in a new issue