@cagatay Found the issue. It appears that the hook I should be calling is in fact action:posts.loaded
and not action:ajaxify.loaded
Should be fixed now but take a look. The best way to test this is to find a topic with lots of posts, and scroll to the bottom. Then, reload the page, and start scrolling up from the bottom to the top. As the new posts are added into the DOM, that function I wrote should execute and add the missing class
For anyone else following this thread, the two required jQuery
functions are
$(window).on('action:posts.loaded', function(data) {
$(document).ready(function() {
if ($('li[component="post"]').hasClass("")) {
console.log("New posts detected,so adding classes for messenger type view");
$('li[component="post"]').addClass('topic-response-post');
}
});
});
$(window).on('action:ajaxify.end', function(data) {
$(document).ready(function() {
if ($('li[component="post"]').hasClass("")) {
console.log("Adding required classes for messenger type view");
$('li[component="post"]').addClass('topic-response-post');
}
});
});