Merge pull request #104 from bhomie:theme-sort

Fix theme sorting
This commit is contained in:
Jack 2020-05-31 15:21:43 +01:00 committed by GitHub
commit 24b9d219f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -400,7 +400,14 @@ let themesList;
$.getJSON("themes/list.json", function(data) {
commandsThemes.list = [];
themesList = data.sort();
themesList = data.sort(function(a, b) {
nameA = a.name.toLowerCase(), nameB = b.name.toLowerCase()
if (nameA < nameB)
return -1
if (nameA > nameB)
return 1
return 0
})
data.forEach(theme => {
commandsThemes.list.push({
id: "changeTheme" + capitalizeFirstLetter(theme.name),