From 87353f5cb22922879ef64b9e788a50a549404132 Mon Sep 17 00:00:00 2001 From: zuber Date: Fri, 8 Jan 2010 01:05:44 +0100 Subject: [PATCH 1/1] =?utf8?q?FIX:=20=C5=81adowanie=20pierwszego=20obrazka?= =?utf8?q?=20w=20galerii.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- platforma/static/js/main.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/platforma/static/js/main.js b/platforma/static/js/main.js index 0928bf8d..a49cb6a0 100644 --- a/platforma/static/js/main.js +++ b/platforma/static/js/main.js @@ -64,7 +64,6 @@ function gallery(element, url) { var pn = $('.page-number', element); pn.change(function(event) { - console.log('change!', $(this).val()); event.preventDefault(); var n = normalizeNumber(pn.val()); pn.val(n); @@ -120,7 +119,10 @@ function gallery(element, url) { galleryWidth: $(this).parent().width(), galleryHeight: $(this).parent().height() }; - console.log('load', imageDimensions) + + if (!(imageDimensions.width && imageDimensions.height)) { + setTimeout(function() { $('img', element).load(); }, 100); + } var position = normalizePosition( image.position().left, image.position().top, @@ -182,7 +184,6 @@ function gallery(element, url) { imageDimensions.width, imageDimensions.height ); - console.log(image.position(), imageDimensions, position); image.css({width: imageDimensions.width, height: imageDimensions.height, left: position.x, top: position.y}); -- 2.20.1