Skip to content

Commit

Permalink
sort by time desc
Browse files Browse the repository at this point in the history
  • Loading branch information
codeskyblue committed Aug 5, 2016
1 parent d89a841 commit acad061
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions res/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,10 @@ var vm = new Vue({
.done(function(res) {
console.log("done", res)
});
}
},
loadAll: function() {
// TODO: move loadFileList here
},
}
})

Expand All @@ -254,7 +257,8 @@ function loadFileList(pathname) {
cache: false,
success: function(res) {
res.files = _.sortBy(res.files, function(f) {
return [f.type, f.name];
// Canot use -f.mtime, have to use Number.MAX_SAFE_INTEGER-f.mtime
return [f.type, Number.MAX_SAFE_INTEGER - f.mtime];
})

vm.files = res.files;
Expand Down

0 comments on commit acad061

Please sign in to comment.