foto: enlarge targeted image pid on load
authorMischa POSLAWSKY <perl@shiar.org>
Wed, 7 Nov 2018 14:31:21 +0000 (15:31 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Wed, 7 Nov 2018 14:31:21 +0000 (15:31 +0100)
Allow specific photos to be linked by photoswipe location hashes
in the form of #gid=1&pid=/data/original.jpg.

foto/album.inc.php

index c3f3464b6386c803af905d8fbce83c1aba98b719..a0a6c70b653ee6b264e49facebd354ffc16e60e8 100644 (file)
@@ -104,6 +104,11 @@ function imgjustify() {
        }
 };
 
+if (request = window.location.hash.match(/pid=(.*)/)) {
+       index = images.findIndex(row => row.src == request[1]);
+       openphotoswipe(index);
+}
+
 window.addEventListener('resize', imgjustify, false);
 imgjustify();