]> git.sesse.net Git - pr0n/commitdiff
Fix an (irrelevant) confusion about addEventListener. master
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 19 Mar 2023 23:33:07 +0000 (00:33 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 19 Mar 2023 23:33:07 +0000 (00:33 +0100)
files/pr0n-fullscreen.js

index ecabed06e0e60a6dad8d1b2b48ee65dc785db935..f08605cb1640f47490c13ec3b7ce3aa19559d6a4 100644 (file)
@@ -128,7 +128,7 @@ function display_image(url, backend_width, backend_height, elem_id, offset)
                if (main_img === null || main_img.complete) {
                        img.src = url;
                } else {
                if (main_img === null || main_img.complete) {
                        img.src = url;
                } else {
-                       main_img.addEventListener('load', function() { img.src = url; }, false);
+                       main_img.addEventListener('load', function() { img.src = url; }, { 'once': true });
                }
 
                // Seemingly one needs to delay position_image(), or Firefox will set the initial
                }
 
                // Seemingly one needs to delay position_image(), or Firefox will set the initial