From 69dec87aa6e1da3ff5554cab2551f00d27e96915 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sun, 17 Jul 2016 15:02:40 -0400 Subject: [PATCH] Allow passing arbitrary values to notifier events from DataObject.save() item.saveTx({ notifierData: { foo: 1 } }); foo: 1 will be included in the extraData[id] object in notify(). --- chrome/content/zotero/xpcom/data/dataObject.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/chrome/content/zotero/xpcom/data/dataObject.js b/chrome/content/zotero/xpcom/data/dataObject.js index 062b780651..8b5e354ef1 100644 --- a/chrome/content/zotero/xpcom/data/dataObject.js +++ b/chrome/content/zotero/xpcom/data/dataObject.js @@ -830,6 +830,10 @@ Zotero.DataObject.prototype.save = Zotero.Promise.coroutine(function* (options) } env.notifierData = {}; + // Pass along any 'notifierData' values + if (env.options.notifierData) { + Object.assign(env.notifierData, env.options.notifierData); + } if (env.options.skipSelect) { env.notifierData.skipSelect = true; }