Bugfix #2281226: Moderation View: Comments disappear when hitting the 'Apply' button without choosing a bulk action.
svn path=/plone.app.discussion/trunk/; revision=33399
This commit is contained in:
parent
9b29be8473
commit
489afd8636
@ -82,24 +82,25 @@ jq(document).ready(function() {
|
|||||||
var params = jq(form).serialize();
|
var params = jq(form).serialize();
|
||||||
var valArray = jq('input:checkbox:checked');
|
var valArray = jq('input:checkbox:checked');
|
||||||
var selectField = jq(form).find("[name='form.select.BulkAction']");
|
var selectField = jq(form).find("[name='form.select.BulkAction']");
|
||||||
if (valArray.length) {
|
if (selectField.val() == '-1') {
|
||||||
|
// XXX: translate message
|
||||||
|
alert("You haven't selected a bulk action. Please select one.");
|
||||||
|
} else if (valArray.length == 0) {
|
||||||
|
// XXX: translate message
|
||||||
|
alert("You haven't selected any comment for this bulk action. Please select at least one comment.");
|
||||||
|
} else {
|
||||||
jq.post(target, params, function(data) {
|
jq.post(target, params, function(data) {
|
||||||
valArray.each(function () {
|
valArray.each(function () {
|
||||||
/* Remove all selected lines. */
|
/* Remove all selected lines. */
|
||||||
var row = jq(this).parent().parent();
|
var row = jq(this).parent().parent();
|
||||||
row.fadeOut("normal", function() {
|
row.fadeOut("normal", function() {
|
||||||
row.remove();
|
row.remove();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
} else {
|
// reset the bulkaction select
|
||||||
// The user has submitted a bulk action, but no comment
|
selectField.find("option[value='-1']").attr( 'selected', 'selected' );
|
||||||
// was selected.
|
|
||||||
// Todo: nicer and translated message
|
|
||||||
alert("You haven't selected anything for this bulk action.");
|
|
||||||
}
|
}
|
||||||
// reset the bulkaction select
|
|
||||||
selectField.find("option[value='-1']").attr( 'selected', 'selected' );
|
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
Loading…
Reference in New Issue
Block a user