]> git.immae.eu Git - perso/Immae/Projets/Nodejs/Surfer.git/blobdiff - app/js/app.js
Show folders first
[perso/Immae/Projets/Nodejs/Surfer.git] / 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;