summaryrefslogtreecommitdiff
path: root/web/source/frontend/index.js
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2025-04-26 15:03:05 +0200
committerLibravatar GitHub <noreply@github.com>2025-04-26 15:03:05 +0200
commitf7323c065a086533ce8c7f0f0cb3f69a80539992 (patch)
treeba1451f4d1c1841bcc0867599673d9527c31f2bf /web/source/frontend/index.js
parent[performance] rewrite timelines to rely on new timeline cache type (#3941) (diff)
downloadgotosocial-f7323c065a086533ce8c7f0f0cb3f69a80539992.tar.xz
[feature] Update attachment format, receive + send `focalPoint` prop + use it on the frontend (#4052)
* [feature] Update attachment format, receive + send `focalPoint` prop + use it on the frontend * whoops * boop * restore function signature of ExtractAttachments
Diffstat (limited to 'web/source/frontend/index.js')
-rw-r--r--web/source/frontend/index.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/web/source/frontend/index.js b/web/source/frontend/index.js
index 47879b2e2..a1c2ca74b 100644
--- a/web/source/frontend/index.js
+++ b/web/source/frontend/index.js
@@ -29,6 +29,7 @@
const Photoswipe = require("photoswipe/dist/umd/photoswipe.umd.min.js");
const PhotoswipeLightbox = require("photoswipe/dist/umd/photoswipe-lightbox.umd.min.js");
const PhotoswipeCaptionPlugin = require("photoswipe-dynamic-caption-plugin").default;
+const ObjectPosition = require("./photoswipe-object-position.js").default;
const Plyr = require("plyr");
const Prism = require("./prism.js");
@@ -61,6 +62,10 @@ new PhotoswipeCaptionPlugin(lightbox, {
}
});
+// Enable object-position plugin for lightbox so that css
+// object-position property can be used on preview images.
+new ObjectPosition(lightbox);
+
lightbox.addFilter('itemData', (item) => {
const el = item.element;
if (