Add loadAllData to Zotero.dataObject
Useful when trying to duplicate items, which requires access to all data
This commit is contained in:
parent
84d8c17d6e
commit
efdc6f1230
|
@ -447,6 +447,14 @@ Zotero.DataObject.prototype._loadDataType = function (dataType, reload) {
|
||||||
return this["load" + dataType[0].toUpperCase() + dataType.substr(1)](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
|
* Save old version of data that's being changed, to pass to the notifier
|
||||||
|
|
|
@ -101,7 +101,7 @@ Zotero.Item.prototype._dataTypes = Zotero.Item._super.prototype._dataTypes.conca
|
||||||
'note',
|
'note',
|
||||||
'creators',
|
'creators',
|
||||||
'childItems',
|
'childItems',
|
||||||
'relatedItems', // TODO: remove
|
// 'relatedItems', // TODO: remove
|
||||||
'tags',
|
'tags',
|
||||||
'collections',
|
'collections',
|
||||||
'relations'
|
'relations'
|
||||||
|
|
Loading…
Reference in New Issue
Block a user