Fix sorting of tag autocomplete in advanced search
This commit is contained in:
parent
9259bfd49a
commit
94b2865149
|
@ -84,18 +84,8 @@ ZoteroAutoComplete.prototype.startSearch = function(searchString, searchParams,
|
||||||
+ "SELECT tagID FROM itemTags WHERE itemID = ?))";
|
+ "SELECT tagID FROM itemTags WHERE itemID = ?))";
|
||||||
sqlParams.push(searchParams.itemID);
|
sqlParams.push(searchParams.itemID);
|
||||||
}
|
}
|
||||||
|
sql += " ORDER BY val COLLATE locale";
|
||||||
statement = this._zotero.DB.getStatement(sql, sqlParams);
|
statement = this._zotero.DB.getStatement(sql, sqlParams);
|
||||||
|
|
||||||
var resultsCallback = function (results) {
|
|
||||||
if (!results) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
var collation = self._zotero.getLocaleCollation();
|
|
||||||
results.sort(function(a, b) {
|
|
||||||
return collation.compareString(1, a.val, b.val);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'creator':
|
case 'creator':
|
||||||
|
@ -246,13 +236,6 @@ ZoteroAutoComplete.prototype.startSearch = function(searchString, searchParams,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (resultsCallback) {
|
|
||||||
if (comments.length) {
|
|
||||||
throw ("Cannot sort results with comments in ZoteroAutoComplete.startSearch()");
|
|
||||||
}
|
|
||||||
resultsCallback(results);
|
|
||||||
}
|
|
||||||
|
|
||||||
self.updateResults(results, comments, true);
|
self.updateResults(results, comments, true);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user