The ajax call to fetch shortname.disqus.com/embed.js is currently inside a .once() method. This means that comment counts are only loaded once.

We have a blog listing view where ajax is used to provide a "load more" button. While the initial batch of blog posts properly show the comment count, any additionally loaded posts don't have their comment count element replaced.

I've solved this by adding this to the theme, but it seems like the module ought to handle this by default - may be as simple as moving the ajax call outside the .once().

Drupal.behaviors.getDisqusComment = {
  attach: function(context, settings){
    // Make the AJAX call to get the number of comments.
    jQuery.ajax({
      type: 'GET',
      url: '//crossco.disqus.com/count.js',
      dataType: 'script',
      cache: false
    });
  }
};

Comments

slashrsm’s picture

That could result in some Disqus code being called more than one time on an element. Not sure if this is problem or not, but we should probably examine that before we commit this.