Run _loadChildItems() in Collection.loadFromRow() so that _childItems.length is calculated properly
This commit is contained in:
parent
7f13072ef4
commit
844fcc0ee9
1 changed files with 3 additions and 0 deletions
|
@ -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());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue