Fix thumbnail not working anymore

This commit is contained in:
yflory 2024-01-15 15:59:51 +01:00
parent af25c8f4b7
commit a852654b45

View file

@ -230,17 +230,17 @@ define([
Thumb.fromDOM = function (opts, cb) {
var element = opts.getContainer();
if (!element) { return; }
var todo = function () {
var todo = function (html2canvas) {
if (!window.html2canvas) { window.html2canvas = html2canvas; }
if (opts.filter) { opts.filter(element, true); }
window.html2canvas(element, {
allowTaint: true,
onrendered: function (canvas) {
if (opts.filter) { opts.filter(element, false); }
setTimeout(function () {
var D = getResizedDimensions(canvas, 'pad');
Thumb.fromCanvas(canvas, D, cb);
}, 10);
}
}).then(function (canvas) {
if (opts.filter) { opts.filter(element, false); }
setTimeout(function () {
var D = getResizedDimensions(canvas, 'pad');
Thumb.fromCanvas(canvas, D, cb);
}, 10);
});
};
if (window.html2canvas) { return void todo(); }