Skip to content

Commit

Permalink
feat(dashboard): sort sidebar resources in alphabetical order
Browse files Browse the repository at this point in the history
  • Loading branch information
ericfong authored and NicolasRitouet committed Dec 16, 2014
1 parent 256554e commit 4cf89a6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/resources/dashboard/js/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ $(document).ready(function() {
var $sidebar = $('#resource-sidebar').empty();

if (resources.length) {
resources = resources.sort(function(a, b){
if (a.id > b.id) return 1;
if (a.id < b.id) return -1;
return 0;
});

$('#resources-empty').hide();
resources.forEach(function(resource) {
var $el = $(resourceSidebarTemplate({resource: resource, types: resourceTypes}));
Expand Down

0 comments on commit 4cf89a6

Please sign in to comment.