From fb97b9f5391f760fa053004834866cb3337e33a1 Mon Sep 17 00:00:00 2001 From: Nicola Murino Date: Tue, 13 May 2025 18:30:21 +0200 Subject: [PATCH] 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 --- templates/webclient/files.html | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/templates/webclient/files.html b/templates/webclient/files.html index 6e33ad37..53197774 100644 --- a/templates/webclient/files.html +++ b/templates/webclient/files.html @@ -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");