Show parent comment responses when a new reply is added
When a user replies to a comment whose responses was hidden at the moment of reply form submission and although the reply were correctly added to the DOM it was hidden because was added to a collapsed list. This solution is about showing all responses of parent comment after adding the new comment to the DOM so the user can see new reply into the screen. (This is not applicable to root comments which cannot be collapsed)
This commit is contained in:
@@ -3,6 +3,10 @@
|
||||
App.Comments = {
|
||||
add_comment: function(parent_selector, response_html) {
|
||||
$(parent_selector + " .comment-list:first").prepend($(response_html));
|
||||
var hidden_responses = $(parent_selector + " .comment-list:first").is(":hidden");
|
||||
if (parent_selector && hidden_responses) {
|
||||
$(parent_selector).find(".comment-list:first").toggle("slow");
|
||||
}
|
||||
this.update_comments_count();
|
||||
},
|
||||
update_comments_count: function() {
|
||||
|
||||
Reference in New Issue
Block a user