Use items-list sort order for report from collection or saved search

https://forums.zotero.org/discussion/99284/exporting-a-report-sorted-by-first-date

Regression from HTML tree
This commit is contained in:
Dan Stillman 2022-08-25 00:45:59 -04:00
parent 262e1964ae
commit 79246196ac
2 changed files with 6 additions and 2 deletions

View file

@ -1808,6 +1808,11 @@ var ItemTree = class ItemTree extends LibraryTree {
return this._rows.map(row => asIDs ? row.ref.id : row.ref);
}
/**
* Get the current sort order of the items list
*
* @return {Number} - -1 for descending, 1 for ascending
*/
getSortDirection(sortFields) {
sortFields = sortFields || this.getSortFields();
if (this.collectionTreeRow.isFeed()) {

View file

@ -30,9 +30,8 @@ var Zotero_Report_Interface = new function() {
*/
this.loadCollectionReport = function () {
var sortColumn = ZoteroPane_Local.getSortField();
var sortDirection = ZoteroPane_Local.getSortDirection();
var queryString = '?sort=' + sortColumn
+ '&direction=' + (sortDirection == 'ascending' ? 'asc' : 'desc');
+ '&direction=' + (ZoteroPane.getSortDirection() == 1 ? 'asc' : 'desc');
var url = 'zotero://report/';