From dfce1e13829d7fe4343aa6a6c06dae17c93102c8 Mon Sep 17 00:00:00 2001 From: wandji Date: Wed, 6 Sep 2023 10:43:51 +0100 Subject: [PATCH] Fix issue previewing large image after edit [SCI-8914] (#6143) --- app/assets/javascripts/sitewide/image_editor.js | 3 ++- app/assets/stylesheets/shared/assets.scss | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/sitewide/image_editor.js b/app/assets/javascripts/sitewide/image_editor.js index df60717bd..7875945f7 100644 --- a/app/assets/javascripts/sitewide/image_editor.js +++ b/app/assets/javascripts/sitewide/image_editor.js @@ -370,7 +370,8 @@ var ImageEditorModal = (function() { $(`.asset[data-asset-id=${data.id}] .attachment-preview img`) .replaceWith($(res.html).find('.attachment-preview img')); $(`.asset[data-asset-id=${data.id}]`).closest('.attachments').trigger('reorder'); - ActiveStoragePreviews.reloadPreview(`.asset[data-asset-id=${data.id}] .attachment-preview img`); + ActiveStoragePreviews.reloadPreview(`.asset[data-asset-id=${data.id}] .attachment-preview img, + .asset[data-asset-id=${data.id}] .image-container img`); closeEditor(); } }); diff --git a/app/assets/stylesheets/shared/assets.scss b/app/assets/stylesheets/shared/assets.scss index 9a41ceeb2..48cf0cdbb 100644 --- a/app/assets/stylesheets/shared/assets.scss +++ b/app/assets/stylesheets/shared/assets.scss @@ -191,6 +191,12 @@ padding: .5em; width: 100%; + &.processing { + background-image: url("/images/medium/loading.svg"); + background-position: center; + background-repeat: no-repeat; + } + img { max-height: 100%; max-width: 100%;