Skip to content

Commit 32ebb17

Browse files
committed
.
1 parent f813520 commit 32ebb17

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

library.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ plugin.myfiltermethod = function myfiltermethod(data, callback) {
1717

1818
$(e).attr('data-src', imgsrc)
1919
$(e).attr('data-exThumbImage', imgsrc)
20-
$(anchorWrapper).attr('data-src', imgsrc)
21-
$(anchorWrapper).attr('href', '#')
20+
$(anchorWrapper).attr('href', imgsrc)
2221
$(e).wrap(anchorWrapper)
2322
})
2423
const html = $('body').html()

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nodebb-plugin-lightgallery",
3-
"version": "2.0.9",
3+
"version": "2.0.10",
44
"nbbpm": {
55
"compatibility": "^1.12.2"
66
},

script.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,9 @@ require(['lightgallery', 'lg-autoplay', 'lg-fullscreen', 'lg-hash', 'lg-pager',
3434

3535
// Initialize on topic infinite scroll
3636
$(window).on('action:topic.loaded', initLightGallery)
37+
38+
// Prevent browser navigation when a gallery link is clicked
39+
$(document).on('click', '[id^=lightgallery] a:has(img)', function (e) {
40+
e.preventDefault()
41+
})
3742
})

0 commit comments

Comments
 (0)