From 173059f6d00faa06dab9188efb2d7536f15861e4 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Tue, 18 Feb 2014 12:29:05 +0100 Subject: Fixed file list sorting Now using a natural sort algorithm that is more consistent between JS and PHP (although not perfect in some corner cases) - added OC.Util.naturalSortComparator that uses the same algo that was used for the user list - changed user list and files list to use OC.Util.naturalSortComparator - removed toLowerCase() and changed the comparator to use String.localeCompare() - added unit tests - added OC_NaturalSort that is used by OCP\Util::naturalSortCompare() --- apps/files/js/filelist.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apps/files/js') diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 532ed466968..383b6c0cd2e 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -1860,7 +1860,7 @@ if (fileInfo1.type !== 'dir' && fileInfo2.type === 'dir') { return 1; } - return fileInfo1.name.localeCompare(fileInfo2.name); + return OC.Util.naturalSortCompare(fileInfo1.name, fileInfo2.name); }, /** * Compares two file infos by size. -- cgit v1.2.3