backoffice: evaluate pre-checked rows for mass actions (#44144)

This commit is contained in:
Frédéric Péters 2020-06-16 18:43:38 +02:00
parent 54647a16f2
commit 5076220306
1 changed files with 4 additions and 5 deletions

View File

@ -33,11 +33,6 @@ function prepare_row_links() {
return false;
}
});
if ($('#listing tbody input[type=checkbox]:checked').length == 0) {
$('form#multi-actions div.buttons').hide();
} else {
$('form#multi-actions div.buttons').show();
}
$('#listing tbody input[type=checkbox]').each(function() {
if ($(this).is(':checked')) {
$(this).parents('tr').addClass('checked');
@ -93,6 +88,10 @@ function prepare_row_links() {
$('form#multi-actions div.buttons').show();
}
});
// hide at first
$('form#multi-actions div.buttons').hide();
// but trigger events in case of prechecked rows
$('#listing input[type=checkbox]:checked').trigger('change');
}
function prepare_column_headers() {