Skip to content

Commit

Permalink
Add .Post-body class to image selector to avoid breaking other extens…
Browse files Browse the repository at this point in the history
…ion that adds images out of the post.

Add exclude class .no-fancybox to allow developer make their extension compatible with this one.
  • Loading branch information
zxy19 committed Aug 27, 2024
1 parent 837d0e9 commit 8fb5072
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion js/dist/forum.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/dist/forum.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/src/forum/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ app.initializers.add('darkle/fancybox', () => {

extend(CommentPost.prototype, 'oncreate', function (vnode) {
this.element
.querySelectorAll('img:not(.emoji):not(.Avatar):not(.PostMeta-ip img):not([data-reaction]):not([data-link-preview]):not(.flamoji img):not(.countryFlag)')
.querySelectorAll('.Post-body img:not(.emoji):not(.Avatar):not(.PostMeta-ip img):not([data-reaction]):not([data-link-preview]):not(.flamoji img):not(.countryFlag):not(.no-fancybox)')
.forEach((node) => {
const fancyboxEl = document.createElement('a');
fancyboxEl.setAttribute('data-fancybox', 'responsive');
Expand Down

0 comments on commit 8fb5072

Please sign in to comment.