From 39b57edfe705be3f21a2bc5670d4c0e3e68c2d17 Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Wed, 7 Nov 2018 15:31:21 +0100 Subject: [PATCH] foto: enlarge targeted image pid on load Allow specific photos to be linked by photoswipe location hashes in the form of #gid=1&pid=/data/original.jpg. --- foto/album.inc.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/foto/album.inc.php b/foto/album.inc.php index c3f3464..a0a6c70 100644 --- a/foto/album.inc.php +++ b/foto/album.inc.php @@ -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(); -- 2.30.0