diff --git a/chrome/content/zotero/components/virtualized-table.jsx b/chrome/content/zotero/components/virtualized-table.jsx index 9adbf1733b..863aa72175 100644 --- a/chrome/content/zotero/components/virtualized-table.jsx +++ b/chrome/content/zotero/components/virtualized-table.jsx @@ -1509,7 +1509,7 @@ var Columns = class { column.sortDirection *= -1; } else { - column.sortDirection = 1; + column.sortDirection = column.defaultSort || 1; } } }); diff --git a/chrome/content/zotero/itemTreeColumns.jsx b/chrome/content/zotero/itemTreeColumns.jsx index 966fb7968a..e2d3743858 100644 --- a/chrome/content/zotero/itemTreeColumns.jsx +++ b/chrome/content/zotero/itemTreeColumns.jsx @@ -33,6 +33,7 @@ const Icons = require('components/icons'); * * defaultIn: Set, // Types of trees the column is default in. Can be [default, feed]; * disabledIn: Set, // Types of trees where the column is not available + * defaultSort: number // Default: 1. -1 for descending sort * * flex: number, // Default: 1. When the column is added to the tree how much space it should occupy as a flex ratio * width: string, // A column width instead of flex ratio. See above. @@ -74,6 +75,7 @@ const COLUMNS = [ { dataKey: "date", defaultIn: new Set(["feed"]), + defaultSort: -1, label: "zotero.items.date_column", flex: 1, zoteroPersist: new Set(["width", "hidden", "sortDirection"]) @@ -81,6 +83,7 @@ const COLUMNS = [ { dataKey: "year", disabledIn: "feed", + defaultSort: -1, label: "zotero.items.year_column", flex: 1, zoteroPersist: new Set(["width", "hidden", "sortDirection"]) @@ -115,6 +118,7 @@ const COLUMNS = [ { dataKey: "accessDate", disabledIn: "feed", + defaultSort: -1, submenu: true, label: "zotero.items.accessDate_column", flex: 1, @@ -145,6 +149,7 @@ const COLUMNS = [ }, { dataKey: "dateAdded", + defaultSort: -1, disabledIn: "feed", label: "zotero.items.dateAdded_column", flex: 1, @@ -152,6 +157,7 @@ const COLUMNS = [ }, { dataKey: "dateModified", + defaultSort: -1, disabledIn: "feed", label: "zotero.items.dateModified_column", flex: 1,