commit cc913cbeed8c061b739b0d01c39832c57685347a parent cf0e1e6972f777a5549e97428b7a3ed3702c1acb Author: Simon Kornblith <simon@simonster.com> Date: Fri, 19 Aug 2011 07:00:22 +0000 Inline id getter Diffstat:
| M | chrome/content/zotero/xpcom/data/item.js | | | 7 | ++++++- |
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/chrome/content/zotero/xpcom/data/item.js b/chrome/content/zotero/xpcom/data/item.js @@ -91,7 +91,12 @@ Zotero.Item.prototype._init = function () { Zotero.Item.prototype.__defineGetter__('objectType', function () { return 'item'; }); -Zotero.Item.prototype.__defineGetter__('id', function () { return this.getField('id'); }); +Zotero.Item.prototype.__defineGetter__('id', function () { + if(!this._id && this._key && !this._primaryDataLoaded) { + this.loadPrimaryData(true); + } + return this._id; +}); Zotero.Item.prototype.__defineGetter__('itemID', function () { Zotero.debug("Item.itemID is deprecated -- use Item.id"); return this.id;