Skip to content

Commit

Permalink
Don't show "Remove Item from Collection" for child items
Browse files Browse the repository at this point in the history
Test forthcoming once tests are working again
  • Loading branch information
dstillman committed May 27, 2017
1 parent aa05920 commit 5d16352
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions chrome/content/zotero/zoteroPane.js
Expand Up @@ -2721,12 +2721,13 @@ var ZoteroPane = new function()
show.push(m.sep3, m.exportItems, m.createBib, m.loadReport);
}

if (this.itemsView.selection.count > 0) {
var items = this.getSelectedItems();

if (items.length > 0) {
// Multiple items selected
if (this.itemsView.selection.count > 1) {
if (items.length.count > 1) {
var multiple = '.multiple';

var items = this.getSelectedItems();
var canMerge = true, canIndex = true, canRecognize = true, canRename = true;
var canMarkRead = collectionTreeRow.isFeed();
var markUnread = true;
Expand Down Expand Up @@ -2821,7 +2822,7 @@ var ZoteroPane = new function()
// Single item selected
else
{
let item = this.getSelectedItems()[0];
let item = items[0];
menu.setAttribute('itemID', item.id);
menu.setAttribute('itemKey', item.key);

Expand Down Expand Up @@ -2934,7 +2935,7 @@ var ZoteroPane = new function()
}

// Remove from collection
if (collectionTreeRow.isCollection() && (!item || item.isTopLevelItem())) {
if (collectionTreeRow.isCollection() && items.every(item => item.isTopLevelItem())) {
menu.childNodes[m.removeItems].setAttribute('label', Zotero.getString('pane.items.menu.remove' + multiple));
show.push(m.removeItems);
}
Expand Down

0 comments on commit 5d16352

Please sign in to comment.