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().
This commit is contained in:
Dan Stillman 2016-07-17 15:02:40 -04:00
parent 4449da7e91
commit 69dec87aa6

View file

@ -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;
}