Automatically reload batch moderation page if no comments are left. This refs #11298.

svn path=/plone.app.discussion/trunk/; revision=51274
This commit is contained in:
Timo Stollenwerk 2011-07-15 17:29:29 +00:00
parent 7225fc78ad
commit dbda349768
2 changed files with 20 additions and 1 deletions

View File

@ -4,6 +4,10 @@ Changelog
2.0.8 (unreleased)
------------------
- Automatically reload batch moderation page if no comments are left. This
fixes http://dev.plone.org/plone/ticket/11298.
[timo]
2.0.7 (2011-07-15)
------------------

View File

@ -36,6 +36,11 @@
$(row).fadeOut("normal", function () {
$(this).remove();
});
// reload page if all comments have been removed
var comments = $("table#review-comments > tbody > tr");
if (comments.length === 1) {
location.reload();
}
},
error: function (msg) {
alert("Error sending AJAX request:" + target);
@ -62,6 +67,11 @@
$(row).fadeOut("normal", function () {
$(this).remove();
});
// reload page if all comments have been removed
var comments = $("table#review-comments > tbody > tr");
if (comments.length === 1) {
location.reload();
}
},
error: function (msg) {
alert("Error sending AJAX request:" + target);
@ -96,6 +106,11 @@
row.remove();
});
});
// reload page if all comments have been removed
var comments = $("table#review-comments > tbody > tr");
if (comments.length <= valArray.length) {
location.reload();
}
});
// reset the bulkaction select
selectField.find("option[value='-1']").attr('selected', 'selected');