Fix edited citation prompt not displaying (regression 25d8898
)
This commit is contained in:
parent
749faabb46
commit
a659c6c6ff
|
@ -997,14 +997,10 @@ Zotero.Integration.Fields.prototype._updateDocument = async function(forceCitati
|
||||||
var formattedCitation = citation.properties.custom
|
var formattedCitation = citation.properties.custom
|
||||||
? citation.properties.custom : citation.text;
|
? citation.properties.custom : citation.text;
|
||||||
var plainCitation = citation.properties.plainCitation && citationField.getText();
|
var plainCitation = citation.properties.plainCitation && citationField.getText();
|
||||||
|
var plaintextChanged = citation.properties.plainCitation
|
||||||
|
&& plainCitation !== citation.properties.plainCitation;
|
||||||
|
|
||||||
// Update citation text:
|
if (!ignoreCitationChanges && plaintextChanged) {
|
||||||
// If we're looking to reset the text even if it matches previous text
|
|
||||||
if (forceCitations == FORCE_CITATIONS_RESET_TEXT
|
|
||||||
// Or metadata has changed thus changing the formatted citation
|
|
||||||
|| (citation.properties.formattedCitation !== formattedCitation)) {
|
|
||||||
|
|
||||||
if (!ignoreCitationChanges && plainCitation !== citation.properties.plainCitation) {
|
|
||||||
// Citation manually modified; ask user if they want to save changes
|
// Citation manually modified; ask user if they want to save changes
|
||||||
Zotero.debug("[_updateDocument] Attempting to update manually modified citation.\n"
|
Zotero.debug("[_updateDocument] Attempting to update manually modified citation.\n"
|
||||||
+ "Original: " + citation.properties.plainCitation + "\n"
|
+ "Original: " + citation.properties.plainCitation + "\n"
|
||||||
|
@ -1019,7 +1015,15 @@ Zotero.Integration.Fields.prototype._updateDocument = async function(forceCitati
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!citation.properties.dontUpdate) {
|
// Update citation text:
|
||||||
|
// If we're looking to reset the text even if it matches previous text
|
||||||
|
if (forceCitations == FORCE_CITATIONS_RESET_TEXT
|
||||||
|
// Or metadata has changed thus changing the formatted citation
|
||||||
|
|| (citation.properties.formattedCitation !== formattedCitation)
|
||||||
|
// Or plaintext has changed and user does not want to keep the change
|
||||||
|
|| (plaintextChanged && !citation.properties.dontUpdate)) {
|
||||||
|
|
||||||
|
|
||||||
// Word will preserve previous text styling, so we need to force remove it
|
// Word will preserve previous text styling, so we need to force remove it
|
||||||
// for citations that were inserted with delay styling
|
// for citations that were inserted with delay styling
|
||||||
if (citation.properties.formattedCitation && citation.properties.formattedCitation.includes(DELAYED_CITATION_STYLING)) {
|
if (citation.properties.formattedCitation && citation.properties.formattedCitation.includes(DELAYED_CITATION_STYLING)) {
|
||||||
|
@ -1032,7 +1036,6 @@ Zotero.Integration.Fields.prototype._updateDocument = async function(forceCitati
|
||||||
citation.properties.plainCitation = citationField.getText();
|
citation.properties.plainCitation = citationField.getText();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
var serializedCitation = citation.serialize();
|
var serializedCitation = citation.serialize();
|
||||||
if (serializedCitation != citation.properties.field) {
|
if (serializedCitation != citation.properties.field) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user