X-Git-Url: http://git.shiar.nl/minimedit.git/blobdiff_plain/ee09c737f25b21db46ed1105a407f2a1ee14cd44..b0b882940b3eb7edb6bd742fa4ff9f8ebbe7abba:/foto/album.inc.php diff --git a/foto/album.inc.php b/foto/album.inc.php index 9410083..a0a6c70 100644 --- a/foto/album.inc.php +++ b/foto/album.inc.php @@ -26,7 +26,7 @@ function openphotoswipe(index) { @@ -74,7 +74,7 @@ function imgjustify() { targetRowHeight: 200, }; var layout = require('justified-layout')(ratios, config); - var thumbreplace = !window.location.search.test(/[?&]blur\b/); + var thumbreplace = !/[?&]blur\b/.test(window.location.search); gallery.style.position = 'relative'; gallery.style.height = layout.containerHeight + 'px'; @@ -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();