Enable image preview for newly uploaded images [SCI-694]

This commit is contained in:
Oleksii Kriuchykhin 2017-01-06 16:41:24 +01:00
parent aa2b573278
commit 89710d8782
2 changed files with 5 additions and 1 deletions

View file

@ -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(

View file

@ -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,