From 08b3eed7da0ca03b806e204edff86b451435ad98 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Fri, 15 Apr 2016 04:17:17 -0400 Subject: [PATCH] Zotero.DataObject._loadDataType() -> .loadDataType() It's generally not necessary to call this, but it can be useful if specific data needs to be loaded in an unloaded library (e.g., an item's creators for RTF Scan) --- chrome/content/zotero/xpcom/data/collection.js | 4 ++-- chrome/content/zotero/xpcom/data/dataObject.js | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/chrome/content/zotero/xpcom/data/collection.js b/chrome/content/zotero/xpcom/data/collection.js index c33cf6191..b4e17e849 100644 --- a/chrome/content/zotero/xpcom/data/collection.js +++ b/chrome/content/zotero/xpcom/data/collection.js @@ -390,7 +390,7 @@ Zotero.Collection.prototype.addItems = Zotero.Promise.coroutine(function* (itemI }); } - yield this._loadDataType('childItems'); + yield this.loadDataType('childItems'); }); /** @@ -435,7 +435,7 @@ Zotero.Collection.prototype.removeItems = Zotero.Promise.coroutine(function* (it } }.bind(this)); - yield this._loadDataType('childItems'); + yield this.loadDataType('childItems'); }); diff --git a/chrome/content/zotero/xpcom/data/dataObject.js b/chrome/content/zotero/xpcom/data/dataObject.js index 061509833..7875ec11d 100644 --- a/chrome/content/zotero/xpcom/data/dataObject.js +++ b/chrome/content/zotero/xpcom/data/dataObject.js @@ -554,7 +554,7 @@ Zotero.DataObject.prototype._addLinkedObject = Zotero.Promise.coroutine(function // // Bulk data loading functions // -// These are called by Zotero.DataObjects.prototype._loadDataType(). +// These are called by Zotero.DataObjects.prototype.loadDataType(). // Zotero.DataObject.prototype.loadPrimaryData = Zotero.Promise.coroutine(function* (reload, failOnMissing) { if (this._loaded.primaryData && !reload) return; @@ -638,7 +638,7 @@ Zotero.DataObject.prototype.reload = Zotero.Promise.coroutine(function* (dataTyp || (!reloadUnchanged && !this._changed[dataType])) { continue; } - yield this._loadDataType(dataType, true); + yield this.loadDataType(dataType, true); } } }); @@ -678,7 +678,7 @@ Zotero.DataObject.prototype._requireData = function (dataType) { * @param {Boolean} reload * @param {Promise} */ -Zotero.DataObject.prototype._loadDataType = function (dataType, reload) { +Zotero.DataObject.prototype.loadDataType = function (dataType, reload) { return this._ObjectsClass._loadDataType(dataType, this.libraryID, [this.id]); } @@ -686,7 +686,7 @@ Zotero.DataObject.prototype.loadAllData = Zotero.Promise.coroutine(function* (re for (let i=0; i