From 0d377a1c4aae2de77e7ed817fd4abafffc8d1d61 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sat, 24 Apr 2021 19:48:27 -0400 Subject: [PATCH] Clear changed state of annotation after saving color change This was resulting in an extra 'modify' event after each sync upload. --- chrome/content/zotero/xpcom/data/item.js | 2 +- test/tests/itemTest.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/data/item.js b/chrome/content/zotero/xpcom/data/item.js index dc48aa8e6d..06229a8665 100644 --- a/chrome/content/zotero/xpcom/data/item.js +++ b/chrome/content/zotero/xpcom/data/item.js @@ -1873,7 +1873,7 @@ Zotero.Item.prototype._saveData = Zotero.Promise.coroutine(function* (env) { }.bind(this)); } - let fields = ['Type', 'Text', 'Comment', 'PageLabel', 'SortIndex', 'Position', 'IsExternal']; + let fields = ['Type', 'Text', 'Comment', 'Color', 'PageLabel', 'SortIndex', 'Position', 'IsExternal']; for (let field of fields) { this._clearChanged('annotation' + field); } diff --git a/test/tests/itemTest.js b/test/tests/itemTest.js index d4b9b868cd..993b2c0aaf 100644 --- a/test/tests/itemTest.js +++ b/test/tests/itemTest.js @@ -1339,6 +1339,7 @@ describe("Zotero.Item", function () { annotation.parentID = attachment.id; annotation.annotationType = 'highlight'; annotation.annotationText = "This is highlighted text."; + annotation.annotationColor = "#ffff66"; annotation.annotationSortIndex = '00015|002431|00000'; annotation.annotationPosition = JSON.stringify({ pageIndex: 123,