]> git.sesse.net Git - pr0n/blobdiff - files/pr0n-fullscreen.js
Update the numbers in the FAQ.
[pr0n] / files / pr0n-fullscreen.js
index 857f3d9c27d654801199142459c933ea60a5277e..181a82cb1e0745bde78677c7c02ca5ab16b6c74f 100644 (file)
@@ -70,7 +70,7 @@ function display_image(width, height, evt, filename, element_id)
        var url = "http://" + global_vhost + "/" + evt + "/" + width + "x" + height + "/" + filename;
        var img = document.getElementById(element_id);
        if (img != null) {
-               img.src = "";
+               img.src = "data:";
                img.parentNode.removeChild(img);
        }
 
@@ -93,15 +93,17 @@ function prepare_preload(img, width, height, evt, filename)
        // cancel any pending preload
        var preload = document.getElementById("preload");
        if (preload != null) {
-               preload.src = "";
+               preload.src = "data:";
                preload.parentNode.removeChild(preload);
        }
-               
-       if (document.all) {  // IE-specific
-               img.onload = "display_image(" + width + "," + height + ",\"" + evt + "\",\"" + filename + "\",\"preload\");";
+
+       // grmf -- IE doesn't fire onload if the image was loaded from cache, so check for
+       // completeness first; should at least be _somewhat_ better
+       if (img.complete) {
+               display_image(width, height, evt, filename, "preload");
        } else {
-               img.onload = function() { display_image(width, height, evt, filename, "preload"); }
-       }
+               img.onload = function() { display_image(width, height, evt, filename, "preload"); };
+       }       
 }
 
 function relayout()