HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

Doesnt work correctly with infinitescroll plugins

Hello Forum,
I am using this reply plugins and infinitescroll plugin (https://vanillaforums.org/addon/infinitescroll-plugin) at the same time.
Without infinitescroll, reply works fine (gives @admin to the textbox).
But when infinitescroll is activated,the textbox doesnt show until last comments and when reply button is clicked before last comments, it jumps to the next page with
post/comment/'.$args['Discussion']->DiscussionID.'/'.urlencode($args['Author']->Name)
(maybe because the comment box is hidden). And at last page (after commentbox is shown) reply works fine.
Now I fixed the commentbox position(position:fixed) and always shown (dispay:block). Even in this case, after you click reply, it jumps to the next page. Is it possible not to jump to the nex page and append @admin to the text box even using infinitescroll plugin?
Is there is any other solutions.
If question is not clear, i am happy to explain again.

I am not sure is this the right place for this question.If not,please let me know.

Thank you in advance.

P:S. unless there is simillar plugins like infinitescroll, i need this anyhow.

Comments

  • Options
    R_JR_J Ex-Fanboy Munich Admin

    @vanillawhisky said:
    Hello Forum,
    I am using this reply plugins and infinitescroll plugin (https://vanillaforums.org/addon/infinitescroll-plugin) at the same time.
    Without infinitescroll, reply works fine (gives @admin to the textbox).
    But when infinitescroll is activated,the textbox doesnt show until last comments and when reply button is clicked before last comments, it jumps to the next page with
    post/comment/'.$args['Discussion']->DiscussionID.'/'.urlencode($args['Author']->Name)

    What do you mean by "it jumps to the next page"? What is "the next page"?

    I think I will not be able to help you. Maybe @Bleistivt can give a hint what's happening and why it is happening. I do not understand very much of the InfiniteScroll plugin since it is quite complex and uses a lot of JavaScript... :(

  • Options

    @R_J said:

    What do you mean by "it jumps to the next page"? What is "the next page"?

    Next page means
    http://example.com/post/comment/2598/admin

  • Options
    R_JR_J Ex-Fanboy Munich Admin

    I'm not sure what's happening here. I use "return false" to prevent the reply link to be really followed and that seems to not be called at all. Using preventDefault leads to quite funny errors with the advanced editor.

    There is a js error when using InfiniteScroll together with the advanced editor, maybe that is the reason.
    There is also a problem with the hidden comment box. Since it is hidden, it cannot be scrolled to.

    To let both plugins work together, reply must communicate somehow with infinite scroll or simulate the manual scroll down process.
    That said... what about a very long discussion where someone clicks reply on the first comment and the complete discussion has to be scrolled by? That sounds awful.

    But anyway: my js skills are not elaborate enough for this problem and I don't think that infinite scroll is a good feature in a forum at all. That's why I will not be able to provide a solution.

  • Options

    To let both plugins work together, reply must communicate somehow with infinite scroll or simulate the manual scroll down process.

    Yes. InfiniteScroll already has this functionality. It could be triggered by simulating a click on the button:

    $('.JTB').click();
    

    @vanillawhisky You would have to wrap line 24-26 of reply.js between if (!$('.JTB').click().length) { and }

Sign In or Register to comment.