Fix thumbnail not working anymore
This commit is contained in:
parent
af25c8f4b7
commit
a852654b45
1 changed files with 8 additions and 8 deletions
|
@ -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(); }
|
||||
|
|
Loading…
Reference in a new issue