From fe9bbd1520092bc054afab35fc32851e9ba56d70 Mon Sep 17 00:00:00 2001 From: Mohammed Buttu Date: Wed, 11 May 2011 13:16:51 -0400 Subject: [PATCH] Fixed image loading order [#485] --- plugins/image/popcorn.image.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/image/popcorn.image.js b/plugins/image/popcorn.image.js index d83b658..b8b0837 100644 --- a/plugins/image/popcorn.image.js +++ b/plugins/image/popcorn.image.js @@ -53,6 +53,10 @@ options.link.style.position = "relative"; options.link.style.textDecoration = "none"; + if ( document.getElementById( options.target ) ) { + document.getElementById( options.target ).appendChild( options.link ); // add the widget's div to the target div + } + var img = document.createElement( 'img' ); img.addEventListener( "load", function() { img.style.borderStyle = "none"; // borders look really bad, if someone wants it they can put it on their div target @@ -61,9 +65,6 @@ options.link.href = options.href; } options.link.target = "_blank"; - if ( document.getElementById( options.target ) ) { - document.getElementById( options.target ).appendChild( options.link ); // add the widget's div to the target div - } var fontHeight = ( img.height / 12 ) + "px"; -- 2.43.0