瀏覽代碼

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 <[email protected]>
Nicola Murino 5 月之前
父節點
當前提交
fb97b9f539
共有 1 個文件被更改,包括 1 次插入14 次删除
  1. 1 14
      templates/webclient/files.html

+ 1 - 14
templates/webclient/files.html

@@ -883,19 +883,6 @@ explicit grant from the SFTPGo Team ([email protected]).
             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 ([email protected]).
             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");