Closes #437, ability to get sorted contents of selected collection/saved search
ZoteroPane.getSortedItems() -- return array of item ids of visible items in current sort order
This commit is contained in:
parent
aec015c039
commit
0f818079bd
|
@ -54,6 +54,7 @@ var ZoteroPane = new function()
|
|||
this.getSelectedCollection = getSelectedCollection;
|
||||
this.getSelectedSavedSearch = getSelectedSavedSearch;
|
||||
this.getSelectedItems = getSelectedItems;
|
||||
this.getSortedItems = getSortedItems;
|
||||
this.getSortField = getSortField;
|
||||
this.getSortDirection = getSortDirection;
|
||||
this.buildCollectionContextMenu = buildCollectionContextMenu;
|
||||
|
@ -762,6 +763,18 @@ var ZoteroPane = new function()
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
* Returns an array of item ids of visible items in current sort order
|
||||
*/
|
||||
function getSortedItems() {
|
||||
if (!itemsView) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return itemsView.getSortedItems();
|
||||
}
|
||||
|
||||
|
||||
function getSortField() {
|
||||
if (!itemsView) {
|
||||
return false;
|
||||
|
|
|
@ -771,6 +771,17 @@ Zotero.ItemTreeView.prototype.rememberSelection = function(selection)
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns an array of item ids of visible items in current sort order
|
||||
*/
|
||||
Zotero.ItemTreeView.prototype.getSortedItems = function() {
|
||||
var ids = [];
|
||||
for each(var item in this._dataItems) {
|
||||
ids.push(item.ref.getID());
|
||||
}
|
||||
return ids;
|
||||
}
|
||||
|
||||
Zotero.ItemTreeView.prototype.getSortField = function() {
|
||||
var col = this._treebox.columns.getSortedColumn().id;
|
||||
// zotero.items._________.column
|
||||
|
|
Loading…
Reference in New Issue
Block a user