Include annotationKey when using "Add Item Note from Annotation"

Fixes #2279
This commit is contained in:
Martynas Bagdonas 2021-12-16 13:09:22 +02:00
parent 88c3e6ca00
commit 78526d7795

View file

@ -303,7 +303,7 @@ class EditorInstance {
} }
/** /**
* @param {Zotero.Item[]} annotations * @param {Object[]} annotations JSON annotations
* @param {Boolean} skipEmbeddingItemData Do not add itemData to citation items * @param {Boolean} skipEmbeddingItemData Do not add itemData to citation items
* @return {Object} Object with `html` string and `citationItems` array to embed into metadata container * @return {Object} Object with `html` string and `citationItems` array to embed into metadata container
*/ */
@ -1457,6 +1457,7 @@ class EditorInstance {
let attachmentItem = Zotero.Items.get(annotation.parentID); let attachmentItem = Zotero.Items.get(annotation.parentID);
let jsonAnnotation = await Zotero.Annotations.toJSON(annotation); let jsonAnnotation = await Zotero.Annotations.toJSON(annotation);
jsonAnnotation.attachmentItemID = attachmentItem.id; jsonAnnotation.attachmentItemID = attachmentItem.id;
jsonAnnotation.id = annotation.key;
jsonAnnotations.push(jsonAnnotation); jsonAnnotations.push(jsonAnnotation);
} }
let html = `<h1>${Zotero.getString('pdfReader.annotations')}<br/>` let html = `<h1>${Zotero.getString('pdfReader.annotations')}<br/>`