improve thumbnails creation performances in code

pull/1/head
yflory 7 years ago
parent 77dcc1c705
commit ecd8ef6418

@ -357,7 +357,7 @@ define([
getContainer: getThumbnailContainer, getContainer: getThumbnailContainer,
filter: function (el, before) { filter: function (el, before) {
if (before) { if (before) {
$(el).parents().css('overflow', 'visible'); //$(el).parents().css('overflow', 'visible');
$(el).css('max-height', Math.max(600, $(el).width()) + 'px'); $(el).css('max-height', Math.max(600, $(el).width()) + 'px');
return; return;
} }

@ -183,8 +183,10 @@ define([
allowTaint: true, allowTaint: true,
onrendered: function (canvas) { onrendered: function (canvas) {
if (opts.filter) { opts.filter(element, false); } if (opts.filter) { opts.filter(element, false); }
var D = getResizedDimensions(canvas, 'pad'); setTimeout(function () {
Thumb.fromCanvas(canvas, D, cb); var D = getResizedDimensions(canvas, 'pad');
Thumb.fromCanvas(canvas, D, cb);
}, 10);
} }
}); });
}; };

Loading…
Cancel
Save