Inline id getter

This commit is contained in:
Simon Kornblith 2011-08-19 07:00:22 +00:00
parent cf0e1e6972
commit cc913cbeed

View File

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