mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-06 22:30:56 +03:00
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:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user