Interface: Add Collections (debugged to view properly)

Interface: Delete collection now reselects correctly.
This commit is contained in:
David Norton 2006-06-05 11:58:16 +00:00
parent d22d77fedf
commit c4d2e77b27
2 changed files with 9 additions and 14 deletions

View file

@ -60,10 +60,10 @@ Scholar.FolderTreeView.prototype.notify = function(action, type, ids)
}
else if(action == 'add' && row == null)
{
var item = Scholar.Items.get(ids[i]);
var item = Scholar.Collections.get(ids[i]);
this._showItem(item,this.rowCount);
this._treebox.rowCountChanged(this.rowCount,1);
this._showItem(new Scholar.ItemGroup('collection',item), 0, this.rowCount);
this._treebox.rowCountChanged(this.rowCount-1,1);
madeChanges = true;
}
@ -216,18 +216,15 @@ Scholar.FolderTreeView.prototype.deleteSelection = function()
this._treebox.beginUpdateBatch();
for (var i=0; i<rows.length; i++)
{
//erase item/collection from DB:
//erase collection from DB:
this._getItemAtRow(rows[i]-i).ref.erase();
/* Disabled for now because notifier handles it this:
//remove row from tree:
this._hideItem(rows[i]-i);
this._treebox.rowCountChanged(rows[i]-i, -1);*/
}
this._treebox.endUpdateBatch();
this._refreshHashMap();
if(end.value < this.rowCount)
this.selection.select(end.value);
else
this.selection.select(this.rowCount-1);
}
Scholar.FolderTreeView.prototype._refreshHashMap = function()

View file

@ -79,9 +79,7 @@ var ScholarPane = new function()
function newCollection()
{
var c = new Scholar.Collection();
//c.setName('Untitled');
//c.save();
Scholar.Collections.add('Untitled Collection');
}
function folderSelected()