MCPcopy Create free account
hub / github.com/error311/FileRise / sortFiles

Function sortFiles

public/js/fileListView.js:8660–8686  ·  view source on GitHub ↗
(column, folder)

Source from the content-addressed store, hash-verified

8658
8659
8660export function sortFiles(column, folder) {
8661 if (sortOrder.column === column) {
8662 sortOrder.ascending = !sortOrder.ascending;
8663 } else {
8664 sortOrder.column = column;
8665 sortOrder.ascending = true;
8666 }
8667
8668 const pane = normalizePaneKey(window.activePane);
8669 const paging = getPaneFileListPaging(pane);
8670 const hasSearch = String(window.currentSearchTerm || '').trim() !== '';
8671 if (paging && !hasSearch && !window.advancedSearchEnabled) {
8672 window.currentPage = 1;
8673 savePaneState(pane, { currentPage: 1 });
8674 loadFileList(folder || window.currentFolder || 'root', { pane, cursor: '' });
8675 return;
8676 }
8677
8678 // Re-sort master fileData
8679 fileData.sort(compareFilesForSort);
8680
8681 if (window.viewMode === "gallery") {
8682 renderGalleryView(folder);
8683 } else {
8684 renderFileTable(folder);
8685 }
8686}
8687
8688function parseCustomDate(dateStr) {
8689 dateStr = dateStr.replace(/\s+/g, " ").trim();

Callers 1

renderFileTableFunction · 0.85

Calls 6

normalizePaneKeyFunction · 0.85
getPaneFileListPagingFunction · 0.85
savePaneStateFunction · 0.85
loadFileListFunction · 0.85
renderGalleryViewFunction · 0.85
renderFileTableFunction · 0.85

Tested by

no test coverage detected