]> git.sesse.net Git - pr0n/commitdiff
When closing fullscreen mode, go back to where we clicked from.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 26 Nov 2015 18:03:26 +0000 (19:03 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 26 Nov 2015 18:03:26 +0000 (19:03 +0100)
files/pr0n-fullscreen.js
perl/Sesse/pr0n/Index.pm

index a52bf8bddf930d3043722e2d0a790e62e3fc42df..2601aa14c3c8693183ca96331b7d5574a4fc5cf5 100644 (file)
@@ -314,7 +314,11 @@ function go_next()
 
 function do_close()
 {
-       window.location = global_return_url;
+       if (global_image_num > 0) {
+               window.location = global_return_url + '#' + (global_image_num + 1);
+       } else {
+               window.location = global_return_url;
+       }
 }
 
 function toggle_optionmenu()
index 68c6a10d386eacb35f193cd51464951f816c4793..3f9e52498e9be02a5338a611c75c5e960d2dbf3f 100644 (file)
@@ -364,7 +364,7 @@ sub handler {
                        } else {
                                $io->print("     ");
                        }
-                       $io->print("<a href=\"$prefix$uri\" onclick=\"location.href='$prefix$fsquery';return false;\"><img src=\"$prefix${thumbxres}x${thumbyres}/$filename\" alt=\"\"$imgsz /></a>\n");
+                       $io->print("<a href=\"$prefix$uri\" id=\"$img_num\" onclick=\"location.href='$prefix$fsquery';return false;\"><img src=\"$prefix${thumbxres}x${thumbyres}/$filename\" alt=\"\"$imgsz /></a>\n");
                
                        if ($rot == 1) {
                                $io->print("      90 <input type=\"checkbox\" name=\"rot-" .