"New Item..." fixed for new Metadatapane overlay.

Minor interface improvements.

(Revision 100!!!!!!!!!!!!!!!!!!)
This commit is contained in:
David Norton 2006-06-01 18:50:16 +00:00
parent 024e1f78e3
commit c2c0f0f614
3 changed files with 26 additions and 18 deletions

View File

@ -6,7 +6,24 @@ Scholar.ItemTreeView = function(itemGroup)
this._itemGroup = itemGroup; this._itemGroup = itemGroup;
this.refresh(); this.refresh();
// Scholar.registerItemTree(this); // this._unregisterID = Scholar.registerItemTree(this);
}
Scholar.ItemTreeView.prototype.refresh = function()
{
this._dataItems = new Array();
this.rowCount = 0;
var newRows = this._itemGroup.getChildItems();
for(var i = 0; i < newRows.length; i++)
this._showItem(newRows[i], i+1); //item ref, before row
this._refreshHashMap();
}
Scholar.ItemTreeView.prototype.unregister = function()
{
Scholar.unregisterItemTree(this._unregisterID);
} }
Scholar.ItemTreeView.prototype.setTree = function(treebox) Scholar.ItemTreeView.prototype.setTree = function(treebox)
@ -167,17 +184,5 @@ Scholar.ItemTreeView.prototype.notify = function(action, type, id)
return; return;
} }
this._refreshHashMap();
}
Scholar.ItemTreeView.prototype.refresh = function()
{
this._dataItems = new Array();
this.rowCount = 0;
var newRows = this._itemGroup.getChildItems();
for(var i = 0; i < newRows.length; i++)
this._showItem(newRows[i], i+1); //item ref, before row
this._refreshHashMap(); this._refreshHashMap();
} }

View File

@ -40,11 +40,13 @@ var ScholarPane = new function()
document.getElementById('scholar-pane').setAttribute('collapsed',!visible); document.getElementById('scholar-pane').setAttribute('collapsed',!visible);
document.getElementById('scholar-splitter').setAttribute('collapsed',!visible); document.getElementById('scholar-splitter').setAttribute('collapsed',!visible);
document.getElementById('scholar-floater').hidden = (!visible || itemsView.selection.count != 1);
} }
function newItem(typeID) function newItem(typeID)
{ {
document.getElementById('content').loadURI('chrome://scholar/content/view.xul?new='+typeID); MetadataPane.viewItem(new Scholar.Item(typeID));
MetadataPane.toggleEdit();
} }
function newCollection() function newCollection()
@ -54,6 +56,9 @@ var ScholarPane = new function()
function folderSelected() function folderSelected()
{ {
//if(itemsView)
// itemsView.unregister();
if(foldersView.selection.count == 1 && foldersView.selection.currentIndex != -1) if(foldersView.selection.count == 1 && foldersView.selection.currentIndex != -1)
{ {
itemsView = new Scholar.ItemTreeView(foldersView._getItemAtRow(foldersView.selection.currentIndex)); itemsView = new Scholar.ItemTreeView(foldersView._getItemAtRow(foldersView.selection.currentIndex));
@ -61,11 +66,11 @@ var ScholarPane = new function()
} }
else if(foldersView.selection.count == 0) else if(foldersView.selection.count == 0)
{ {
document.getElementById('items-tree').view = null; document.getElementById('items-tree').view = itemsView = null;
} }
else else
{ {
document.getElementById('items-tree').view = null; document.getElementById('items-tree').view = itemsView = null;
} }
} }

View File

@ -67,13 +67,11 @@ tree #items-tree
#scholar-floater vbox #scholar-floater vbox
{ {
border: 1px solid #a5a5a5; border: 1px solid #a5a5a5;
background: #f5f5f5; background: #f5f5f5;
width: 400px; width: 400px;
max-width: 400px; max-width: 400px;
margin-top: 5px;
} }
#scholar-metadata #scholar-metadata