mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-24 15:54:00 +08:00
Add workaround for image caching in fabric js [SCI-2855]
This commit is contained in:
parent
80e525fd97
commit
feb75f62e1
3 changed files with 9 additions and 5 deletions
|
@ -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');
|
||||
});
|
||||
|
|
|
@ -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?
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue