Piwigo / piwigo-bootstrap-darkroom

A mobile-ready and feature-rich theme for Piwigo photo gallery, based on Bootstrap 4
Apache License 2.0
83 stars 40 forks source link

Allow direct-linking of PhotoSwipe images #319

Closed sebageek closed 2 years ago

sebageek commented 2 years ago

When PhotoSwipe is enabled as "detailed view" and a user browses through the gallery, the current image is always reflected in the url in the form of "#&gid=x&pid=y". When a link is opened already containing this info (i.e. a direct link to an image in the gallery) we now parse the pid out of this querystring-like string and pass it to startPhotoSwipe(). As pid is 1-based and startPhotoSwipe()'s index is 0-based we need to substract one from the given pid.

Fixes #318