talk icon indicating copy to clipboard operation
talk copied to clipboard

Update Comment count on Ajax call (Infinite scroll)

Open errand opened this issue 4 years ago • 5 comments

When using dynamic content load comment count is blank. I try to call count.js via ajax call with no luck. Does anybody has a recipe?

errand avatar Apr 02 '20 11:04 errand

Can you give an example of how the elements are loaded? Corals count.js currently doesn't monitor the page for insertions of new data-coral-* attributes, as it's only done once on dom load.

wyattjoh avatar Apr 02 '20 15:04 wyattjoh

For example https://www.andreaverlicchi.eu/lazyload/ script has useful update() function to check DOM again when for example (in my case) new content is being appended to container as user scrolls down, in my case i use Drupal7 with Infinite scroll module (https://www.drupal.org/project/gd_infinite_scroll). So when the new elements append to container i fire update function so the comment count shows up. Currently it's empty of course.

errand avatar Apr 02 '20 16:04 errand

GD infinite scroll project https://git.drupalcode.org/project/gd_infinite_scroll/-/blob/7.x-1.x/js/gd_infinite_scroll.js

errand avatar Apr 02 '20 16:04 errand

That's sufficient! Coral doesn't currently have a mechanism for this currently, but we've added it to our backlog.

wyattjoh avatar Apr 02 '20 21:04 wyattjoh

any updates regarding this? i've integrated coral talk on a page with infinite scroll containing articles and each article has it's own comment section. so far so good, but the count script only works for the top article unless you reload further down. comments and everything else are working just fine.

martintorn avatar Mar 28 '22 14:03 martintorn

we're looking into solutions to modernize our comment counts solutions but no timeline as of yet unfortunately

tessalt avatar Jan 23 '23 15:01 tessalt