mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-10 17:36:33 +08:00
Merge pull request #6382 from G-Chubinidze/gc_SCI_9433
Missing file preview [SCI-9433]
This commit is contained in:
commit
93861a1b22
2 changed files with 2 additions and 19 deletions
|
@ -36,19 +36,8 @@ class AssetsController < ApplicationController
|
|||
def toggle_view_mode
|
||||
@asset.view_mode = toggle_view_mode_params[:view_mode]
|
||||
@asset.save!(touch: false)
|
||||
gallery_view_id = if @assoc.is_a?(Step)
|
||||
@assoc.id
|
||||
elsif @assoc.is_a?(Result)
|
||||
@assoc.my_module.id
|
||||
end
|
||||
render json: {
|
||||
html: render_to_string(
|
||||
partial: 'assets/asset', locals: {
|
||||
asset: @asset,
|
||||
gallery_view_id: gallery_view_id
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
render json: AssetSerializer.new(@asset, scope: { user: current_user }).as_json
|
||||
end
|
||||
|
||||
def load_asset
|
||||
|
|
|
@ -139,12 +139,6 @@
|
|||
type: 'PATCH',
|
||||
dataType: 'json',
|
||||
data: { asset: { view_mode: viewMode } }
|
||||
}).done(data => {
|
||||
this.$nextTick(function() {
|
||||
$(`.asset[data-asset-id=${this.attachment.id}] img`)
|
||||
.replaceWith($(data.html).find(`.asset[data-asset-id=${this.attachment.id}] img`));
|
||||
ActiveStoragePreviews.reloadPreview(`.asset[data-asset-id=${this.attachment.id}] img`);
|
||||
})
|
||||
});
|
||||
},
|
||||
deleteAttachment() {
|
||||
|
|
Loading…
Reference in a new issue