www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 46eb84e859e4972b2177d91fb395097378af144d
parent 38330e4c137ec5b1573ef38d46e31db661315020
Author: Dan Stillman <dstillman@zotero.org>
Date:   Thu, 29 Mar 2018 07:11:15 -0400

Add Zotero.Item.prototype.parentItem getter

Diffstat:
Mchrome/content/zotero/xpcom/data/item.js | 3+++
1 file changed, 3 insertions(+), 0 deletions(-)

diff --git a/chrome/content/zotero/xpcom/data/item.js b/chrome/content/zotero/xpcom/data/item.js @@ -145,6 +145,9 @@ Zotero.defineProperty(Zotero.Item.prototype, 'parentItemKey', { get: function() { return this.parentKey; }, set: function(val) { return this.parentKey = val; } }); +Zotero.defineProperty(Zotero.Item.prototype, 'parentItem', { + get: function() { return Zotero.Items.get(this.parentID) || undefined; }, +}); Zotero.defineProperty(Zotero.Item.prototype, 'firstCreator', {