Show correct context menu and itemPane header for collections in trash ()

- only have enabled "Permanently delete" and "Restore to library"
options in the context menu for collections and searches in the trash
- display the custom header with buttons to delete or restore
in the itemPane when a collection or search in the trash is selected

Fixes: 
This commit is contained in:
abaevbog 2024-06-28 13:42:45 -07:00 committed by GitHub
parent df8a4799e1
commit 2dfb243924
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions
chrome/content/zotero

View file

@ -492,7 +492,9 @@
getCurrentPane(mode = undefined) {
if (!mode) {
// Guess a mode from the current data
if (!this.data.length || this.data.length > 1) {
// No/multiple objects are selected OR selected object is a trashed collection/search
if (!this.data.length || this.data.length > 1
|| this.data[0] instanceof Zotero.Collection || this.data[0] instanceof Zotero.Search) {
mode = "message";
}
else if (this.data[0].isNote()) {

View file

@ -3558,7 +3558,7 @@ var ZoteroPane = new function()
show.add(m.loadReport);
}
var items = this.getSelectedItems();
var items = this.getSelectedObjects();
if (items.length > 0) {
// Multiple items selected