Fix group collection sort

This commit is contained in:
Dan Stillman 2009-05-31 05:57:43 +00:00
parent 7ba742779e
commit 5ec339c9df

View file

@ -186,7 +186,6 @@ Zotero.Group.prototype.getCollections = function (parent) {
var sql = "SELECT collectionID FROM collections WHERE libraryID=? AND "
+ "parentCollectionID " + (parent ? '=' + parent : 'IS NULL');
var ids = Zotero.DB.columnQuery(sql, this.libraryID);
Zotero.debug(ids);
// Return Zotero.Collection objects
var objs = [];
@ -194,6 +193,13 @@ Zotero.Group.prototype.getCollections = function (parent) {
var col = Zotero.Collections.get(id);
objs.push(col);
}
// Do proper collation sort
var collation = Zotero.getLocaleCollation();
objs.sort(function (a, b) {
return collation.compareString(1, a.name, b.name);
});
return objs;
}