]> git.immae.eu Git - perso/Immae/Projets/Nodejs/Surfer.git/commitdiff
Show folders first
authorJohannes Zellner <johannes@nebulon.de>
Tue, 1 Mar 2016 17:18:12 +0000 (18:18 +0100)
committerJohannes Zellner <johannes@nebulon.de>
Tue, 1 Mar 2016 17:18:12 +0000 (18:18 +0100)
app/js/app.js

index c942e605b903734021e35a5252b4aba557b9334d..4f84ea26e8b48660b0633f20752ef6eae974ac34 100644 (file)
@@ -81,6 +81,7 @@ function loadDirectory(filePath) {
         if (error) return console.error(error);
         if (result.statusCode === 401) return logout();
 
+        result.body.entries.sort(function (a, b) { return a.isDirectory && b.isFile ? -1 : 1 });
         app.entries = result.body.entries.map(function (entry) {
             entry.previewUrl = getPreviewUrl(entry, filePath);
             return entry;