Skip to content

Commit f337b51

Browse files
authored
Merge pull request #52 from nexB/41-refactored-jstree-icons-and-sorting
#41: Fix jsTree icons and sorting in refactored code
2 parents f1bf3c7 + f0b9a1a commit f337b51

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# <img src="assets/images/aboutcode-logo.png" align="center" alt="AboutCode Manager">
22

33
AboutCode Manager provides an advanced visual UI to help you quickly evaluate
4-
license and other notices identified by [ScanCode] (https://github.com/nexB/scancode-toolkit/) and record your conclusion
4+
license and other notices identified by [ScanCode](https://github.com/nexB/scancode-toolkit/) and record your conclusion
55
about the effective license(s) for a component. AboutCode Manager is based on
66
Electron and will be the primary desktop/GUI tool for using nexB’s AboutCode
77
tools. This app works on Windows, OS X and Linux operating systems.

assets/js/renderer.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,17 @@ $(document).ready(function () {
3939
"icon": "glyphicon glyphicon-file"
4040
}
4141
},
42-
"plugins": [ "types"]
42+
"plugins": [ "types","sort" ],
43+
'sort': function (a, b) {
44+
a1 = this.get_node(a);
45+
b1 = this.get_node(b);
46+
if (a1.type == b1.type) {
47+
return a1.text.localeCompare(b1.text, 'en-US-u-kf-upper');
48+
}
49+
else {
50+
return (a1.type === 'directory') ? -1 : 1;
51+
}
52+
}
4353
})
4454
.on('open_node.jstree', function (evt, data) {
4555
data.instance.set_icon(

0 commit comments

Comments
 (0)