Merge pull request #1081 from cycomachead/project-sorting

Minor Improvements to Project Open Dialog
dev
Jens Mönig 2015-12-22 08:15:32 +01:00
commit 964a47313f
1 zmienionych plików z 7 dodań i 3 usunięć

10
gui.js
Wyświetl plik

@ -5112,7 +5112,10 @@ ProjectDialogMorph.prototype.setSource = function (source) {
this.projectList = []; this.projectList = [];
SnapCloud.getProjectList( SnapCloud.getProjectList(
function (projectList) { function (projectList) {
myself.installCloudProjectList(projectList); // Don't show cloud projects if user has since switch panes.
if (myself.source === 'cloud') {
myself.installCloudProjectList(projectList);
}
msg.destroy(); msg.destroy();
}, },
function (err, lbl) { function (err, lbl) {
@ -5227,7 +5230,7 @@ ProjectDialogMorph.prototype.getLocalProjectList = function () {
} }
} }
projects.sort(function (x, y) { projects.sort(function (x, y) {
return x.name < y.name ? -1 : 1; return x.name.toLowerCase() < y.name.toLowerCase() ? -1 : 1;
}); });
return projects; return projects;
}; };
@ -5240,7 +5243,8 @@ ProjectDialogMorph.prototype.installCloudProjectList = function (pl) {
var myself = this; var myself = this;
this.projectList = pl || []; this.projectList = pl || [];
this.projectList.sort(function (x, y) { this.projectList.sort(function (x, y) {
return x.ProjectName < y.ProjectName ? -1 : 1; return x.ProjectName.toLowerCase() < y.ProjectName.toLowerCase() ?
-1 : 1;
}); });
this.listField.destroy(); this.listField.destroy();