From: Mischa POSLAWSKY Date: Wed, 7 Nov 2018 14:31:21 +0000 (+0100) Subject: foto: enlarge targeted image pid on load X-Git-Tag: v3.8~11 X-Git-Url: http://git.shiar.net/minimedit.git/commitdiff_plain/39b57edfe705be3f21a2bc5670d4c0e3e68c2d17 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. --- 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();