Update parent comment responses count when a new reply is created

Extract the needed portion of code to a new partial to be able to update
only the elements needed when a new comment is added keeping UI properly
updated.
This commit is contained in:
Senén Rodero Rodríguez
2020-05-08 07:00:30 +02:00
parent 095abbf9a7
commit 956f002738
12 changed files with 144 additions and 9 deletions

View File

@@ -14,6 +14,9 @@
$(this).text(new_val);
});
},
update_responses_count: function(comment_id, responses_count_html) {
$(comment_id + "_reply .responses-count").html(responses_count_html);
},
display_error: function(field_with_errors, error_html) {
$(error_html).insertAfter($("" + field_with_errors));
},