mirror of
https://github.com/mickael-kerjean/filestash.git
synced 2026-01-09 22:39:35 -06:00
fix (table): improve ux for sam/bam tables
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
"avi": "video/x-msvideo",
|
||||
"avif": "image/avif",
|
||||
"avro": "application/vnd.apache.avro",
|
||||
"bam": "application/x-bam",
|
||||
"bin": "application/octet-stream",
|
||||
"bmp": "image/x-ms-bmp",
|
||||
"bz2": "application/x-bz2",
|
||||
@@ -215,6 +216,7 @@
|
||||
"rtf2": "text/rtf",
|
||||
"run": "application/x-makeself",
|
||||
"rw2": "image/x-panasonic-rw2",
|
||||
"sam": "application/x-sam",
|
||||
"sea": "application/x-sea",
|
||||
"sew": "image/x-sew",
|
||||
"sgi": "image/x-sgi",
|
||||
|
||||
@@ -238,8 +238,12 @@ function resizeLastColumnIfNeeded({ $target, $childs, padding = 0 }) {
|
||||
function sortBy(rows, ascending, key) {
|
||||
const o = ascending ? 1 : -1;
|
||||
return rows.sort((a, b) => {
|
||||
if (a[key] === b[key]) return 0;
|
||||
else if (a[key] < b[key]) return -o;
|
||||
return o;
|
||||
let diff = a[key] - b[key];
|
||||
if (isNaN(diff)) {
|
||||
if (a[key] === b[key]) diff = 0;
|
||||
else if (a[key] < b[key]) diff = -1;
|
||||
else diff = 1;
|
||||
}
|
||||
return o*diff;
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user