Skip to content

Commit

Permalink
fix sort
Browse files Browse the repository at this point in the history
  • Loading branch information
codeskyblue committed Aug 5, 2016
1 parent acad061 commit b94703f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions res/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,8 @@ function loadFileList(pathname) {
cache: false,
success: function(res) {
res.files = _.sortBy(res.files, function(f) {
// Canot use -f.mtime, have to use Number.MAX_SAFE_INTEGER-f.mtime
return [f.type, Number.MAX_SAFE_INTEGER - f.mtime];
var weight = f.type == 'dir' ? 1000 : 1;
return -weight * f.mtime;
})

vm.files = res.files;
Expand Down

0 comments on commit b94703f

Please sign in to comment.