Skip to content

Commit 0c5ff18

Browse files
authored
fix: images not correctly attributed via data-gallery (#163, #168)
Signed-off-by: squidfunk <martin.donath@squidfunk.com>
1 parent ea3f70a commit 0c5ff18

3 files changed

Lines changed: 7 additions & 13 deletions

File tree

dist/assets/javascripts/bundle.ee611ef6.min.js renamed to dist/assets/javascripts/bundle.eadb2f62.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/base.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@
273273
</script>
274274
{% endblock %}
275275
{% block scripts %}
276-
<script src="{{ 'assets/javascripts/bundle.ee611ef6.min.js' | url }}"></script>
276+
<script src="{{ 'assets/javascripts/bundle.eadb2f62.min.js' | url }}"></script>
277277
{% for script in config.extra_javascript %}
278278
{{ script | script_tag }}
279279
{% endfor %}

src/assets/javascripts/components/content/glightbox/index.ts

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import {
2727
EMPTY,
2828
Observable,
2929
catchError,
30-
fromEvent,
3130
map,
3231
of,
3332
shareReplay,
@@ -123,17 +122,12 @@ export function mountGLightbox(
123122
)
124123

125124
// Create and return component
126-
return fetchStyles().pipe(switchMap(() => glightbox$))
125+
return fetchStyles()
127126
.pipe(
128-
switchMap(gallery => {
129-
gallery.setElements(els)
130-
return els.map((el, index) => {
131-
fromEvent(el, "click").subscribe(ev => {
132-
ev.preventDefault()
133-
gallery.openAt(index)
134-
})
135-
return { ref: el }
136-
})
127+
switchMap(() => glightbox$),
128+
switchMap(glightbox => {
129+
glightbox.reload()
130+
return els.map(el => ({ ref: el }))
137131
})
138132
)
139133
}

0 commit comments

Comments
 (0)