Changes to note insertion for MacWord
This commit is contained in:
parent
45a3e96e68
commit
06e1c404bd
1 changed files with 10 additions and 2 deletions
|
@ -1371,10 +1371,18 @@ Zotero.Integration.Session.prototype.cite = async function (field) {
|
||||||
await citationsByItemIDPromise;
|
await citationsByItemIDPromise;
|
||||||
|
|
||||||
let citations = await this._insertCitingResult(fieldIndex, field, io.citation);
|
let citations = await this._insertCitingResult(fieldIndex, field, io.citation);
|
||||||
// We need to re-update from document because we've inserted multiple fields.
|
if (citations.length > 1) {
|
||||||
// Don't worry, the field list and info is cached so this triggers no calls to the doc.
|
// We need to refetch fields because we've inserted multiple.
|
||||||
|
// This is not super optimal, but you're inserting 2+ citations at the time,
|
||||||
|
// so that sets it off
|
||||||
|
var fields = await this.getFields(true);
|
||||||
|
}
|
||||||
|
// And resync citations with ones in the doc
|
||||||
await this.updateFromDocument(FORCE_CITATIONS_FALSE);
|
await this.updateFromDocument(FORCE_CITATIONS_FALSE);
|
||||||
for (let citation of citations) {
|
for (let citation of citations) {
|
||||||
|
if (fields) {
|
||||||
|
citation._field = new Zotero.Integration.CitationField(fields[citation._fieldIndex]);
|
||||||
|
}
|
||||||
await this.addCitation(citation._fieldIndex, await citation._field.getNoteIndex(), citation);
|
await this.addCitation(citation._fieldIndex, await citation._field.getNoteIndex(), citation);
|
||||||
}
|
}
|
||||||
return citations;
|
return citations;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue