Add workaround for image caching in fabric js [SCI-2855]

This commit is contained in:
Oleksii Kriuchykhin 2018-11-16 17:01:48 +01:00 committed by Anton Ignatov
parent 80e525fd97
commit feb75f62e1
3 changed files with 9 additions and 5 deletions
app
assets/javascripts/sitewide
controllers
views/shared

View file

@ -18,9 +18,14 @@
});
}
<<<<<<< HEAD:app/assets/javascripts/sitewide/file_preview.js.erb
function initImageEditor(data) {
// var ImageEditor = require('tui-image-editor');
=======
function initImageEditor(data) {
var imageEditor;
>>>>>>> 50ccdbc6... Add workaround for image caching in fabric js [SCI-2855]:app/assets/javascripts/sitewide/file_preview.js
var blackTheme = {
'common.bi.image': '',
'common.bisize.width': '0',
@ -104,10 +109,9 @@
'colorpicker.title.color': '#fff'
};
var imageEditor = new tui.ImageEditor('#tui-image-editor', {
imageEditor = new tui.ImageEditor('#tui-image-editor', {
includeUI: {
loadImage: {
// path: data['large-preview-url'],
path: data['download-url'],
name: data.filename
},
@ -146,7 +150,8 @@
}
}).done(function() {
animateSpinner(null, false);
imageEditor.clearObjects();
imageEditor.destroy();
imageEditor = {};
$('#tui-image-editor').html('');
$('#fileEditModal').modal('hide');
});

View file

@ -50,7 +50,7 @@ class AssetsController < ApplicationController
'filename' => truncate(@asset.file_file_name,
length:
Constants::FILENAME_TRUNCATION_LENGTH),
'download-url' => download_asset_path(@asset)
'download-url' => download_asset_path(@asset, timestamp: Time.now.to_i)
}
if @asset.is_image?

View file

@ -1,7 +1,6 @@
<div id="fileEditModal"
class="modal modal-file-edit"
role="dialog"
tabindex="-1"
aria-labelledby="fileEditModal"
aria-hidden="true"
data-backdrop="static"