Skip to content

Commit c92079c

Browse files
committed
sort navtree, related silentHoo@493c73c
1 parent 1fc0d6f commit c92079c

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

assets/js/filenavigator.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,16 @@
6363
}
6464
parent.nodes.push({name: absName, nodes: []});
6565
}
66+
67+
// sort nodes by name
68+
parent.nodes = parent.nodes.sort(function(a, b) {
69+
if (a.name < b.name) {
70+
return -1;
71+
} else if (a.name > b.name) {
72+
return 1;
73+
}
74+
return 0;
75+
});
6676
};
6777

6878
!self.history.length && self.history.push({name: path, nodes: []});

0 commit comments

Comments
 (0)