From 4aa41653be2b31117b33dcac053bab4e14c969fe Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Mon, 7 Oct 2013 10:56:19 +0200 Subject: [PATCH] Fixed thumbnail problem with multiple files --- public_html/media/js/upload.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public_html/media/js/upload.js b/public_html/media/js/upload.js index c2e58a6d..6c6c4832 100644 --- a/public_html/media/js/upload.js +++ b/public_html/media/js/upload.js @@ -114,12 +114,12 @@ $(function() continue; } + var img = postDom.find('img') var reader = new FileReader(); - reader.onload = (function(theFile) + reader.onload = (function(theFile, img) { return function(e) { - var img = postDom.find('img') /*img.css('max-width', img.css('width')); img.css('max-height', img.css('height')); img.css('width', 'auto'); @@ -127,7 +127,7 @@ $(function() img.css('background-image', 'none'); img.attr('src', e.target.result); }; - })(file); + })(file, img); reader.readAsDataURL(file); } $('#upload-step2').fadeIn(function()