X-Git-Url: https://git.sesse.net/?p=pr0n;a=blobdiff_plain;f=files%2Fpr0n-fullscreen.js;h=fe31090131fd1b7a546482e2219ad0a5fb59c2db;hp=661cea75818ef03582a5e6b2f06c3776a44762f8;hb=060aaacf0d15a03ed7287cf81169f630a1a1f95b;hpb=6eef2c55c264bcb6f3a7fcc05ff9ae2b816314cb diff --git a/files/pr0n-fullscreen.js b/files/pr0n-fullscreen.js index 661cea7..fe31090 100644 --- a/files/pr0n-fullscreen.js +++ b/files/pr0n-fullscreen.js @@ -50,6 +50,7 @@ function find_width() * pick_image_size, below. */ var fixed_sizes = [ + [ 2304, 1728 ], [ 2048, 1536 ], [ 1920, 1440 ], [ 1600, 1200 ], @@ -113,17 +114,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; }