commit 844fcc0ee957afafc18ea7c37d89754dac762bda
parent 7f13072ef4b49df30007e039b777be6760e7e05d
Author: Dan Stillman <dstillman@zotero.org>
Date: Tue, 15 Aug 2006 20:38:20 +0000
Run _loadChildItems() in Collection.loadFromRow() so that _childItems.length is calculated properly
Diffstat:
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git a/chrome/chromeFiles/content/scholar/xpcom/data_access.js b/chrome/chromeFiles/content/scholar/xpcom/data_access.js
@@ -2214,6 +2214,7 @@ Scholar.Collection.prototype.loadFromRow = function(row){
this._parent = row['parentCollectionID'];
this._hasChildCollections = row['hasChildCollections'];
this._hasChildItems = row['hasChildItems'];
+ this._loadChildItems();
}
@@ -2348,6 +2349,7 @@ Scholar.Collection.prototype.addItem = function(itemID){
// If this was previously empty, update and send a notification to the tree
if (!this._hasChildItems){
this._hasChildItems = true;
+ // DEBUG: is this necessary?
Scholar.Notifier.trigger('modify', 'collection', this.getID());
}
@@ -2388,6 +2390,7 @@ Scholar.Collection.prototype.removeItem = function(itemID){
// If this was the last item, set collection to empty
if (!this._childItems.length){
this._hasChildItems = false;
+ // DEBUG: is this necessary?
Scholar.Notifier.trigger('modify', 'collection', this.getID());
}