Add the image size to keep formatting even when the image is still loading
authorBenoit Dien <benoit.dien@gmail.com>
Sat, 30 Jul 2011 21:33:27 +0000 (23:33 +0200)
committerGuillaume Cottenceau <gcottenc@gmail.com>
Wed, 3 Aug 2011 11:47:47 +0000 (13:47 +0200)
data/booh/themes/gradient/root/booh.js

index 5158919..009a311 100644 (file)
@@ -263,7 +263,7 @@ function show_current_text() {
 function display_current() {
     var main_img = document.getElementById('main_img');
     if (types[current] == 'image') {
-        main_img.innerHTML = '<div class="fullscreen_image"><img src="' + images[current] + '"/></div>';
+        main_img.innerHTML = '<div class="fullscreen_image"><img style="width:' + widths[current] + 'px;height:' + heights[current] + 'px" src="' + images[current] + '"/></div>';
     } else {
         main_img.innerHTML = '<a class="fullscreenvideolink" href="' + videos[current] + '" '
                            + '   style="display:block;width:' + widths[current] + 'px;height:' + (heights[current] + 24) + 'px" id="player">'