WebClient: Fix multi-page selection

removed legacy workaround code that was likely introduced to mask
a bug in the DataTable component.
This underlying issue has since been resolved and this code cause
issues now.

Fixes #1971

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino
2025-05-13 18:30:21 +02:00
parent c5a8d672d2
commit fb97b9f539

View File

@@ -883,19 +883,6 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
dt.on('user-select', function(e, dt, type, cell, originalEvent){
let pageSelected = dt.rows({ selected: true, page: 'current' }).count();
let totalSelected = dt.rows({ selected: true, search: 'applied' }).count();
if (totalSelected > pageSelected){
let currentIndexes = [];
dt.rows({ page: 'current' }).every(function (rowIdx, tableLoop, rowLoop){
currentIndexes.push(rowIdx);
});
dt.rows().deselect();
currentIndexes.forEach((idx) => {
dt.row(idx).select();
});
totalSelected = dt.rows({ selected: true, search: 'applied' }).count();
}
if ($(originalEvent.target).is(':checked')){
pageSelected++;
totalSelected++;
@@ -915,7 +902,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
const selectAllContainer = document.querySelector('[data-kt-filemanager-table-select="select_all_pages_container"]');
const selectAllCheck = document.querySelector('[data-kt-filemanager-table-select="select_all_pages"]');
if (pageSelected > 0) {
if (totalSelected > 0) {
let pageTotal = dt.rows({ page: 'current' }).count();
if (pageSelected === pageTotal){
selectAllContainer.classList.remove("d-none");