Fix comments not being lazy loaded in streams anymore

This commit is contained in:
Benjamin Neff
2023-11-11 01:12:53 +01:00
parent df8275f000
commit 3e1407d242
2 changed files with 9 additions and 7 deletions

View File

@@ -109,7 +109,7 @@
url: toggleReactionsLink.attr("href"),
success: function (data) {
toggleReactionsLink.addClass("active").removeClass("loading");
$(data).insertAfter(bottomBar.children(".show-comments").first());
$(data).insertAfter(bottomBar.children(".post-actions-container").first());
self.showCommentBox(commentActionLink);
bottomBarContainer.getCommentsContainer().find("time.timeago").timeago();
bottomBarContainer.activate();

View File

@@ -19,17 +19,19 @@
- if post.is_a?(StatusMessage)
= render "status_messages/status_message", post: post, photos: post.photos
.bottom-bar.nsfw-hidden{class: ("inactive" unless defined?(expanded_info) && expanded_info)}
- expanded_info = defined?(expanded_info) && expanded_info
.bottom-bar.nsfw-hidden{class: ("inactive" unless expanded_info)}
.post-actions-container
!= show_comments_link(post, defined?(expanded_info) && expanded_info ? "active" : "")
!= show_comments_link(post, expanded_info ? "active" : "")
= render partial: "comments/post_stats", locals: {post: post}
.comment-container
%ul.comments
= render partial: "comments/comment", collection: post.comments.for_a_stream, locals: {post: post}
- if expanded_info
.comment-container
%ul.comments
= render partial: "comments/comment", collection: post.comments.for_a_stream, locals: {post: post}
.ajax-loader.hidden
.loader
.spinner
.add-comment-switcher{class: ("hidden" unless defined?(expanded_info) && expanded_info)}
.add-comment-switcher{class: ("hidden" unless expanded_info)}
= render partial: "comments/new_comment", locals: {post_id: post.id}