mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-08-05 12:57:25 +02:00
Fix natural sort for file size.
This commit is contained in:
@@ -107,13 +107,18 @@ modulejs.define('ext/sort', ['_', '$', 'core/settings', 'core/resource', 'core/e
|
||||
return res;
|
||||
}
|
||||
|
||||
val1 = '' + getValue(item1);
|
||||
val2 = '' + getValue(item2);
|
||||
val1 = getValue(item1);
|
||||
val2 = getValue(item2);
|
||||
|
||||
if (isNaN(val1) || isNaN(val2)) {
|
||||
val1 = '' + val1;
|
||||
val2 = '' + val2;
|
||||
|
||||
if (ignorecase) {
|
||||
val1 = val1.toLowerCase();
|
||||
val2 = val2.toLowerCase();
|
||||
}
|
||||
}
|
||||
|
||||
if (natural) {
|
||||
res = naturalCmpFn(val1, val2);
|
||||
@@ -130,7 +135,7 @@ modulejs.define('ext/sort', ['_', '$', 'core/settings', 'core/resource', 'core/e
|
||||
var headers = $('#items li.header a'),
|
||||
header = $('#items li.header a.' + columnClasses[column]),
|
||||
|
||||
fn = cmpFn(columnGetters[column], reverse, settings.ignorecase, settings.natural),
|
||||
fn = cmpFn(columnGetters[column], reverse, settings.ignorecase, column === 0 && settings.natural),
|
||||
|
||||
current = $('#items .item'),
|
||||
sorted = $('#items .item').sort(fn);
|
||||
|
Reference in New Issue
Block a user