How To Trigger Comment Reply

Posted in: Newspaper
Post count: 38

I seem to have a bug on my site and can’t get to the bottom of it. I am running the latest version of newspaper and the “Reply” link under comments is not working anymore. I can see the click event is not attached to any of the comments so it’s impossible to reply.

I have seen from the demo site that when you click Reply normally, it will bring you down to the comment input and the title there will change to “Reply to Bob”. For the moment, I think the best I can do is add my own click event manually. I just need some advice on what to call.

If i use the comment below as an example

<a rel="nofollow" class="comment-reply-link" href="#comment-37353" data-commentid="37353" data-postid="1145" data-belowelement="comment-37353" data-respondelement="respond" data-replyto="Reply to Roxanna" aria-label="Reply to Roxanna">Reply</a>

I could use some jQuery to capture the click and I just need to know what function from the newspaper js library I need to call to trigger the comment reply?

$( ".comment-reply-link" ).click(function() {
var commentId = $(this).data("commentid")
triggerReply(commentId); //What function can I call here?
});

  • This topic was modified 4 years by dano1066.
  • This topic was modified 4 years by dano1066.
  • This topic was modified 4 years by dano1066.
Post count: 35449

Hi,
The reply on comments should be working like this -> https://i.imgur.com/hW1QotS.png if this is not working, then it is possible that something to interfere with the theme, most of the time it is an untested plugin.
I suggest to check this first.
Thank you!

Post count: 38

Hey Calin, you are correct and i have observed the comments working this way on demo sites. I have tried disabling plugins and I have not been able to find it. I have two websites, both using Newspaper and one works, the other doesn’t. I can’t identify the differences between them that is causing this. My last resort for now is to add the event handler back. If you can tell me what JS function I can call, I will be able to quickly add this back for now until I can find the actual cause. There are no JS errors in the console.

Edit

I have found the cause. I disabled Rocket Loader™ from Cloudflare and comment replies are working again. Is this a known conflict with the theme?

  • This reply was modified 4 years by dano1066.
Post count: 27744

Hi,

This is a known issue while you are using the tagDiv Composer and this option can interfere with our builder and block some js scripts. We recommend you disable the Rocket Loader -> https://forum.tagdiv.com/cloudflare-cdn/

Thank you!

Viewing 4 posts - 1 through 4 (of 4 total)
The forum ‘Newspaper’ is closed to new topics and replies.