From 0df26d1d2d385798c4b33c4ef17de8ba200c3edd Mon Sep 17 00:00:00 2001 From: rmzelle Date: Fri, 20 Mar 2015 21:39:55 -0400 Subject: [PATCH] No prompt for remove if no top-level items are selected As requested at https://github.com/zotero/zotero/pull/668#issuecomment-84090670 --- chrome/content/zotero/zoteroPane.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/zoteroPane.js b/chrome/content/zotero/zoteroPane.js index a2b2bed4d..0b7a9b231 100644 --- a/chrome/content/zotero/zoteroPane.js +++ b/chrome/content/zotero/zoteroPane.js @@ -1610,7 +1610,13 @@ var ZoteroPane = new function() var prompt = (force && !fromMenu) ? false : toTrash; } else if (itemGroup.isCollection()) { - // In collection, only prompt if trashing + + // Ignore unmodified action if only child items are selected + if (!force && this.itemsView.getSelectedItems().every(item => !item.isTopLevelItem())) { + return; + } + + // In collection var prompt = force ? toTrash : toRemove; } else if (itemGroup.isSearch() || itemGroup.isUnfiled() || itemGroup.isDuplicates()) {