Fix JS comment deletion

If the comment tree had just one top level comment the whole tree was
removed by the JS code if just one comment in the tree was deleted.
These comments were (correctly) not removed from the ZODB.
This commit is contained in:
Gaudenz Steinlin 2012-05-07 11:11:19 +02:00
parent 1b0ba3c0b0
commit 4e0bf9f25e
2 changed files with 17 additions and 21 deletions

View File

@ -4,6 +4,9 @@ Changelog
2.1.6 (unreleased) 2.1.6 (unreleased)
------------------ ------------------
- Fix excessive JS comment deletion.
[gaudenz]
- No longer depend on zope.app packages. - No longer depend on zope.app packages.
[hannosch] [hannosch]

View File

@ -179,12 +179,6 @@
url: form_url, url: form_url,
context: $(trigger).parents(".comment"), context: $(trigger).parents(".comment"),
success: function (data) { success: function (data) {
if ($(".discussion .replyTreeLevel0").length === 1) {
$(".discussion").fadeOut('fast', function () {
$(".discussion").remove();
});
}
else {
var comment = $(this); var comment = $(this);
var clss = comment.attr('class'); var clss = comment.attr('class');
// remove replies // remove replies
@ -203,7 +197,6 @@
$(this).fadeOut('fast', function () { $(this).fadeOut('fast', function () {
$(this).remove(); $(this).remove();
}); });
}
}, },
error: function (req, error) { error: function (req, error) {
return true; return true;