A small fix to make some loads of /box/ redundant.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 14 Jul 2014 11:06:10 +0000 (13:06 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 14 Jul 2014 11:06:10 +0000 (13:06 +0200)
files/pr0n-fullscreen.js

index 661cea75818ef03582a5e6b2f06c3776a44762f8..8c02b45e13cad0a442f5442aae1c50d38b6148f8 100644 (file)
@@ -113,17 +113,16 @@ function replace_image_element(url, element_id, parent_node)
 {
        var img = document.getElementById(element_id);
        if (img !== null) {
+               if (img.src === url) {
+                       return img;
+               }
                img.parentNode.removeChild(img);
        }
 
        img = document.createElement("img");
        img.id = element_id;
        img.alt = "";
-
-       if (img.src != url) {
-               img.src = url;
-       }
-       
+       img.src = url;
        parent_node.appendChild(img);
        return img;
 }