diff --git a/chrome/chromeFiles/content/scholar/itemTreeView.js b/chrome/chromeFiles/content/scholar/itemTreeView.js index c32752eb4a..e4fbeb65f6 100644 --- a/chrome/chromeFiles/content/scholar/itemTreeView.js +++ b/chrome/chromeFiles/content/scholar/itemTreeView.js @@ -6,7 +6,24 @@ Scholar.ItemTreeView = function(itemGroup) this._itemGroup = itemGroup; 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) @@ -167,17 +184,5 @@ Scholar.ItemTreeView.prototype.notify = function(action, type, id) 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(); } \ No newline at end of file diff --git a/chrome/chromeFiles/content/scholar/overlay.js b/chrome/chromeFiles/content/scholar/overlay.js index 73f1c91dd4..01b8ada3d4 100644 --- a/chrome/chromeFiles/content/scholar/overlay.js +++ b/chrome/chromeFiles/content/scholar/overlay.js @@ -40,11 +40,13 @@ var ScholarPane = new function() document.getElementById('scholar-pane').setAttribute('collapsed',!visible); document.getElementById('scholar-splitter').setAttribute('collapsed',!visible); + document.getElementById('scholar-floater').hidden = (!visible || itemsView.selection.count != 1); } function newItem(typeID) { - document.getElementById('content').loadURI('chrome://scholar/content/view.xul?new='+typeID); + MetadataPane.viewItem(new Scholar.Item(typeID)); + MetadataPane.toggleEdit(); } function newCollection() @@ -54,6 +56,9 @@ var ScholarPane = new function() function folderSelected() { + //if(itemsView) + // itemsView.unregister(); + if(foldersView.selection.count == 1 && foldersView.selection.currentIndex != -1) { itemsView = new Scholar.ItemTreeView(foldersView._getItemAtRow(foldersView.selection.currentIndex)); @@ -61,11 +66,11 @@ var ScholarPane = new function() } else if(foldersView.selection.count == 0) { - document.getElementById('items-tree').view = null; + document.getElementById('items-tree').view = itemsView = null; } else { - document.getElementById('items-tree').view = null; + document.getElementById('items-tree').view = itemsView = null; } } diff --git a/chrome/chromeFiles/skin/default/scholar/overlay.css b/chrome/chromeFiles/skin/default/scholar/overlay.css index bf34ddb539..8b82492956 100644 --- a/chrome/chromeFiles/skin/default/scholar/overlay.css +++ b/chrome/chromeFiles/skin/default/scholar/overlay.css @@ -67,13 +67,11 @@ tree #items-tree #scholar-floater vbox { - border: 1px solid #a5a5a5; background: #f5f5f5; width: 400px; max-width: 400px; - margin-top: 5px; } #scholar-metadata