From ecd8ef641869f1cb9afd4090f91e97608bb3dd6b Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 9 Jan 2018 15:25:11 +0100 Subject: [PATCH] improve thumbnails creation performances in code --- www/code/inner.js | 2 +- www/common/common-thumbnail.js | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/www/code/inner.js b/www/code/inner.js index e7bdfb5f1..d1e402aaa 100644 --- a/www/code/inner.js +++ b/www/code/inner.js @@ -357,7 +357,7 @@ define([ getContainer: getThumbnailContainer, filter: function (el, before) { if (before) { - $(el).parents().css('overflow', 'visible'); + //$(el).parents().css('overflow', 'visible'); $(el).css('max-height', Math.max(600, $(el).width()) + 'px'); return; } diff --git a/www/common/common-thumbnail.js b/www/common/common-thumbnail.js index 18e5dff52..f0ba27194 100644 --- a/www/common/common-thumbnail.js +++ b/www/common/common-thumbnail.js @@ -183,8 +183,10 @@ define([ allowTaint: true, onrendered: function (canvas) { if (opts.filter) { opts.filter(element, false); } - var D = getResizedDimensions(canvas, 'pad'); - Thumb.fromCanvas(canvas, D, cb); + setTimeout(function () { + var D = getResizedDimensions(canvas, 'pad'); + Thumb.fromCanvas(canvas, D, cb); + }, 10); } }); };