Skip to content

Commit

Permalink
Sort the folder list reactively (#146)
Browse files Browse the repository at this point in the history
* Sort the folder list reactively

* Always show root directory

* Update comment
  • Loading branch information
dneukirchen authored and laoneo committed Apr 3, 2017
1 parent b01ec76 commit f3427d1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
/* Get the directories */
directories() {
return this.$store.state.directories
.filter(directory => (directory.directory === this.root));
.filter(directory => (directory.directory === this.root))
.sort((a, b) => {
// Sort alphabetically
return (a.name.toUpperCase() < b.name.toUpperCase()) ? -1 : 1
});
},
}
}
Expand Down
2 changes: 2 additions & 0 deletions media/com_media/js/mediamanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -9139,6 +9139,8 @@ exports.default = {

return this.$store.state.directories.filter(function (directory) {
return directory.directory === _this.root;
}).sort(function (a, b) {
return a.name.toUpperCase() < b.name.toUpperCase() ? -1 : 1;
});
}
}
Expand Down

0 comments on commit f3427d1

Please sign in to comment.