From 46eb84e859e4972b2177d91fb395097378af144d Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Thu, 29 Mar 2018 07:11:15 -0400 Subject: [PATCH] Add Zotero.Item.prototype.parentItem getter --- chrome/content/zotero/xpcom/data/item.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/chrome/content/zotero/xpcom/data/item.js b/chrome/content/zotero/xpcom/data/item.js index 83a3d1df7e..ab36b4ac86 100644 --- 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', {