Add loadAllData to Zotero.dataObject

Useful when trying to duplicate items, which requires access to all data
This commit is contained in:
Aurimas Vinckevicius 2014-11-14 04:44:23 -06:00
parent 84d8c17d6e
commit efdc6f1230
2 changed files with 9 additions and 1 deletions

View File

@ -447,6 +447,14 @@ Zotero.DataObject.prototype._loadDataType = function (dataType, reload) {
return this["load" + dataType[0].toUpperCase() + dataType.substr(1)](reload);
}
Zotero.DataObject.prototype.loadAllData = function (reload) {
let loadPromises = new Array(this._dataTypes.length);
for (let i=0; i<this._dataTypes.length; i++) {
loadPromises[i] = this._loadDataType(this._dataTypes[i], reload);
}
return Zotero.Promise.all(loadPromises);
}
/**
* Save old version of data that's being changed, to pass to the notifier

View File

@ -101,7 +101,7 @@ Zotero.Item.prototype._dataTypes = Zotero.Item._super.prototype._dataTypes.conca
'note',
'creators',
'childItems',
'relatedItems', // TODO: remove
// 'relatedItems', // TODO: remove
'tags',
'collections',
'relations'