Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions lib/modules/showImages.js
Original file line number Diff line number Diff line change
Expand Up @@ -1137,7 +1137,7 @@ function generateMedia(options: ExpandoMedia, context: {| href: string |}): Medi
if (options.caption) options.caption = DOMPurify.sanitize(options.caption);

switch (options.type) {
case 'GALLERY': return new Gallery(options, context);
case 'GALLERY': return new Gallery(options);
case 'IMAGE': return new Image(options, context);
case 'TEXT': return new Text(options);
case 'IFRAME': return new Iframe(options);
Expand Down Expand Up @@ -1399,7 +1399,7 @@ class Gallery extends Media {
rememberResizeWidth: boolean;
lastResizedWidth: number;

constructor(options: GalleryMedia, context) {
constructor(options: GalleryMedia) {
super();

this.element = galleryTemplate({
Expand All @@ -1418,7 +1418,8 @@ class Gallery extends Media {
this.ctrlConcurrentIncrease = this.element.querySelector('.res-gallery-increase-concurrent');

this.pieces = options.src.map(src => ({
generateMedia: () => generateMedia(src, context),
// Use the piece's source, not the gallery's URL, as the context
generateMedia: () => generateMedia(src, { href: src.src }),
media: null,
wrapper: string.html`<div hidden></div>`,
}));
Expand Down