From dc09bf5307907bfcd46b7cf76893a4a87c156d65 Mon Sep 17 00:00:00 2001 From: julian laplace Date: Thu, 27 Oct 2022 17:21:02 +0200 Subject: file sorting --- public/assets/js/lib/views/stream/hootstream.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/public/assets/js/lib/views/stream/hootstream.js b/public/assets/js/lib/views/stream/hootstream.js index 50b2f46..d13ae0a 100644 --- a/public/assets/js/lib/views/stream/hootstream.js +++ b/public/assets/js/lib/views/stream/hootstream.js @@ -344,7 +344,11 @@ var HootStream = View.extend({ return null; } const $table = $("
"); - for (const file of files.sort((file) => file.filename.toLowerCase())) { + const sortedFiles = files + .map((file) => [file.filename.toLowerCase(), file]) + .sort((a, b) => a[0].localeCompare(b[0])) + .map(([, file]) => file); + for (const file of sortedFiles) { const $el = this.renderFile(this.fileTemplate, file); $table.append($el); } -- cgit v1.2.3-70-g09d2