Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tohsakarat committed Jun 6, 2023
1 parent ebd642d commit 4fcff59
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 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.

13 changes: 6 additions & 7 deletions js/src/forum/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ app.initializers.add('darkle/fancybox', () => {
console.log('fancybox initializePost')

var elements1=Array.prototype.slice.call(this.element.querySelectorAll('img:not(.emoji):not(.Avatar):not(.flaemoji-customized):not([data-reaction]):not([data-link-preview])'))
var elements2=Array.prototype.slice.call(this.element.querySelectorAll(':is(blockquote,details,.bbspoiler-blur,.chatroom,.no-fancybox) img:not(.emoji):not(.Avatar):not(.flaemoji-customized):not([data-reaction]):not([data-link-preview])'))
var elements2=Array.prototype.slice.call(this.element.querySelectorAll(':is(blockquote,details,.bbspoiler-blur,.chatroom,.no-fancybox) img:not(.emoji):not(.Avatar):not(.flaemoji-customized):not([data-reaction]):not([data-link-preview]), .editing img'))

elements1=elements1.filter((e) =>{
return elements2.indexOf(e) == -1

Expand All @@ -59,8 +59,8 @@ app.initializers.add('darkle/fancybox', () => {
node.setAttribute('transed', 'true');

if(
this.attrs.post.data.attributes.number <Math.floor(app.current.data.stream.index-1)+1
&&this.attrs.post.data.attributes.number <Math.floor(app.current.data.stream.index-1)-1
this.attrs.post.data.attributes.number <Math.floor(app.current.data.stream.index-1)+1
&&this.attrs.post.data.attributes.number <Math.floor(app.current.data.stream.index-1)-1
){
//符合条件的加fancybx
const fancyboxEl = document.createElement('a');
Expand All @@ -87,11 +87,10 @@ app.initializers.add('darkle/fancybox', () => {
var elements1=Array.prototype.slice.call(document.querySelectorAll(
'.PostStream-item[data-index="'+Math.floor(app.current.data.stream.index-1) +'"] '+selector+','+
'.PostStream-item[data-index="'+(Math.floor(app.current.data.stream.index-1)-1)+'"] '+selector+','+
'.PostStream-item[data-index="'+(Math.floor(app.current.data.stream.index-1)+1) +'"] '+selector+','+
' .editing '+selector
'.PostStream-item[data-index="'+(Math.floor(app.current.data.stream.index-1)+1) +'"] '+selector
))

var elements2=Array.prototype.slice.call(document.querySelectorAll(':is(blockquote,details,.bbspoiler-blur,.chatroom,.no-fancybox) img:not(.emoji):not(.Avatar):not(.flaemoji-customized):not([data-reaction]):not([data-link-preview])'))
var elements2=Array.prototype.slice.call(document.querySelectorAll(':is(blockquote,details,.bbspoiler-blur,.chatroom,.no-fancybox) img:not(.emoji):not(.Avatar):not(.flaemoji-customized):not([data-reaction]):not([data-link-preview]), .editing img'))

elements1=elements1.filter((e) =>{
return elements2.indexOf(e) == -1
Expand Down

0 comments on commit 4fcff59

Please sign in to comment.