Fix itemTreeView.getSortField() and getSortDirection() if no column selected -- this was breaking report generation on initial installs
This commit is contained in:
parent
593c3c1128
commit
8e4de076d1
|
@ -840,14 +840,24 @@ Zotero.ItemTreeView.prototype.getSortedItems = function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
Zotero.ItemTreeView.prototype.getSortField = function() {
|
Zotero.ItemTreeView.prototype.getSortField = function() {
|
||||||
var col = this._treebox.columns.getSortedColumn().id;
|
var column = this._treebox.columns.getSortedColumn()
|
||||||
|
if (!column) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
// zotero.items._________.column
|
// zotero.items._________.column
|
||||||
return col.substring(13, col.length-7);
|
return column.substring(13, column.length-7);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Returns 'ascending' or 'descending'
|
||||||
|
*/
|
||||||
Zotero.ItemTreeView.prototype.getSortDirection = function() {
|
Zotero.ItemTreeView.prototype.getSortDirection = function() {
|
||||||
return this._treebox.columns.getSortedColumn().element.getAttribute('sortDirection');
|
var column = this._treebox.columns.getSortedColumn();
|
||||||
|
if (!column) {
|
||||||
|
return 'ascending';
|
||||||
|
}
|
||||||
|
return column.element.getAttribute('sortDirection');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user