kopia lustrzana https://github.com/backface/turtlestitch
Merge pull request #1081 from cycomachead/project-sorting
Minor Improvements to Project Open Dialogdev
commit
964a47313f
10
gui.js
10
gui.js
|
@ -5112,7 +5112,10 @@ ProjectDialogMorph.prototype.setSource = function (source) {
|
|||
this.projectList = [];
|
||||
SnapCloud.getProjectList(
|
||||
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();
|
||||
},
|
||||
function (err, lbl) {
|
||||
|
@ -5227,7 +5230,7 @@ ProjectDialogMorph.prototype.getLocalProjectList = function () {
|
|||
}
|
||||
}
|
||||
projects.sort(function (x, y) {
|
||||
return x.name < y.name ? -1 : 1;
|
||||
return x.name.toLowerCase() < y.name.toLowerCase() ? -1 : 1;
|
||||
});
|
||||
return projects;
|
||||
};
|
||||
|
@ -5240,7 +5243,8 @@ ProjectDialogMorph.prototype.installCloudProjectList = function (pl) {
|
|||
var myself = this;
|
||||
this.projectList = pl || [];
|
||||
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();
|
||||
|
|
Ładowanie…
Reference in New Issue