Disable PDF annotation transfer in group libraries

This commit is contained in:
Dan Stillman 2022-02-06 17:15:26 -05:00
parent cc0687a574
commit bf9ef5fc01

View file

@ -154,12 +154,16 @@ const ZoteroStandalone = new function() {
catch (e) {}
this.updateMenuItemEnabled('manage-attachments-menu', active);
// PDF annotation transfer ("Import Annotation"/"Store Annotations in File")
let reader = Zotero.Reader.getByTabID(Zotero_Tabs.selectedID);
if (reader) {
let item = Zotero.Items.get(reader.itemID);
let library = Zotero.Libraries.get(item.libraryID);
if (item
&& Zotero.Libraries.get(item.libraryID).editable
&& !(item.deleted || item.parentItem && item.parentItem.deleted)) {
// Don't allow annotation transfer in group libraries
&& library.libraryType == 'user'
&& library.editable
&& !(item.deleted || item.parentItem && item.parentItem.deleted)) {
let annotations = item.getAnnotations();
let canTransferFromPDF = annotations.find(x => x.annotationIsExternal);
let canTransferToPDF = annotations.find(x => !x.annotationIsExternal);