Fix sorting of autocomplete tags dropdown (since Fx9 or so)

This commit is contained in:
Dan Stillman 2012-05-10 18:55:17 -04:00
parent cd39b5d0e4
commit 66bfaaae13

View file

@ -90,7 +90,7 @@ ZoteroAutoComplete.prototype.startSearch = function(searchString, searchParam, p
var resultsCallback = function (results) { var resultsCallback = function (results) {
var collation = self._zotero.getLocaleCollation(); var collation = self._zotero.getLocaleCollation();
results.sort(function(a, b) { results.sort(function(a, b) {
return collation.compareString(1, a, b); return collation.compareString(1, a.val, b.val);
}); });
} }
break; break;
@ -208,6 +208,11 @@ ZoteroAutoComplete.prototype.startSearch = function(searchString, searchParam, p
// Disable asynchronous until we figure out the hangs // Disable asynchronous until we figure out the hangs
if (true) { if (true) {
var rows = this._zotero.DB.query(sql, sqlParams); var rows = this._zotero.DB.query(sql, sqlParams);
if (resultsCallback) {
resultsCallback(rows);
}
var results = []; var results = [];
var comments = []; var comments = [];
for each(var row in rows) { for each(var row in rows) {