Locate menu: Get selected item(s) from current tab
This commit is contained in:
parent
424afb9af6
commit
f44cc548f9
1 changed files with 18 additions and 6 deletions
|
@ -326,6 +326,7 @@ var Zotero_LocateMenu = new function() {
|
|||
* Get the first 50 selected items
|
||||
*/
|
||||
function _getSelectedItems() {
|
||||
if (Zotero_Tabs.selectedID == 'zotero-pane') {
|
||||
var allSelectedItems = ZoteroPane_Local.getSelectedItems();
|
||||
var selectedItems = [];
|
||||
while (selectedItems.length < 50 && allSelectedItems.length) {
|
||||
|
@ -334,6 +335,17 @@ var Zotero_LocateMenu = new function() {
|
|||
}
|
||||
return selectedItems;
|
||||
}
|
||||
else {
|
||||
var reader = Zotero.Reader.getByTabID(Zotero_Tabs.selectedID);
|
||||
if (reader) {
|
||||
let item = Zotero.Items.get(reader.itemID);
|
||||
if (item.parentItem) {
|
||||
return [item.parentItem];
|
||||
}
|
||||
}
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
var ViewOptions = {};
|
||||
|
||||
|
|
Loading…
Reference in a new issue