Make creator-based report sorting slightly less broken
This commit is contained in:
parent
da09a8dfcd
commit
2bf4c81a62
2 changed files with 10 additions and 1 deletions
|
@ -40,7 +40,7 @@ var Zotero_Report_Interface = new function() {
|
|||
var sortColumn = ZoteroPane_Local.getSortField();
|
||||
var sortDirection = ZoteroPane_Local.getSortDirection();
|
||||
if (sortColumn != 'title' || sortDirection != 'ascending') {
|
||||
queryString = '?sort=' + sortColumn + (sortDirection != 'ascending' ? '' : '/d');
|
||||
queryString = '?sort=' + sortColumn + (sortDirection == 'ascending' ? '' : '/d');
|
||||
}
|
||||
|
||||
if (col) {
|
||||
|
|
|
@ -424,6 +424,15 @@ function ChromeExtensionHandler() {
|
|||
valA = Zotero.Date.strToMultipart(a[sorts[index].field]);
|
||||
valB = Zotero.Date.strToMultipart(b[sorts[index].field]);
|
||||
}
|
||||
// TEMP: This is an ugly hack to make creator sorting
|
||||
// slightly less broken. To do this right, real creator
|
||||
// sorting needs to be abstracted from itemTreeView.js.
|
||||
else if (sorts[index].field == 'firstCreator') {
|
||||
var itemA = Zotero.Items.getByLibraryAndKey(a.libraryID, a.key);
|
||||
var itemB = Zotero.Items.getByLibraryAndKey(b.libraryID, b.key);
|
||||
valA = itemA.getField('firstCreator');
|
||||
valB = itemB.getField('firstCreator');
|
||||
}
|
||||
else {
|
||||
valA = a[sorts[index].field];
|
||||
valB = b[sorts[index].field];
|
||||
|
|
Loading…
Reference in a new issue