Skip to content

Commit

Permalink
Sort alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
BKSteve committed Sep 1, 2024
1 parent f40d45b commit e287884
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion sickchill/gui/slick/js/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,21 @@
let list = null;
let link = null;

const innerData = $.grep(data, (value, index) => index !== 0);
// Log data to debug
console.log("Received data:", data);

Check failure on line 40 in sickchill/gui/slick/js/browser.js

View workflow job for this annotation

GitHub Actions / Test (ubuntu-latest, 3.11, false)

Strings must use singlequote.

const preData = $.grep(data, (value, index) => index !== 0);
// Separate folders and files
const folders = preData.filter(item => item.type === 'folder');
const files = preData.filter(item => item.type !== 'folder');

// Sort folders and files alphabetically
folders.sort((a, b) => a.name.localeCompare(b.name));
files.sort((a, b) => a.name.localeCompare(b.name));

// Concatenate sorted folders and files
const innerData = folders.concat(files);

const inputContainer = $('<div class="fileBrowserFieldContainer"></div>');

$('<input type="text" class="form-control input-sm">').val(currentBrowserPath).on('keypress', event => {
Expand Down

0 comments on commit e287884

Please sign in to comment.