Make ajax call for delete comment button work for comment replies.

svn path=/plone.app.discussion/trunk/; revision=40853
This commit is contained in:
Timo Stollenwerk 2010-10-27 16:10:04 +00:00
parent 926e4f6b8e
commit 14e2600a79

View File

@ -169,14 +169,15 @@
var form = $(this).parents("form"); var form = $(this).parents("form");
var data = $(form).serialize(); var data = $(form).serialize();
var form_url = $(form).attr("action"); var form_url = $(form).attr("action");
var comment_div = form.parent().parent();
$.ajax({ $.ajax({
type:'POST', type:'POST',
url:form_url, url:form_url,
context: $(trigger).parents(".comment"), context: $(trigger).parents(".comment"),
success: function(data) { success: function(data) {
if($(".discussion .comment").length == 1) { if($(".discussion .comment").length == 1) {
$(".discussion").fadeOut('fast', function() { comment_div.fadeOut('fast', function() {
$(".discussion").remove(); comment_div.remove();
}); });
} }
else { else {