commit 22d6e93478ba643d02dcdfa9d4dcc702eaee4617
parent 74e2d5a842ff591c18ede7114a95b2a4c9f3326d
Author: David Norton <david@nortoncrew.com>
Date: Tue, 23 May 2006 15:04:25 +0000
Edit pane is now at the top of the window.
Hash map is created to keep track of rows by item ID.
Diffstat:
2 files changed, 25 insertions(+), 1 deletion(-)
diff --git a/chrome/chromeFiles/content/scholar/editpane.xul b/chrome/chromeFiles/content/scholar/editpane.xul
@@ -7,7 +7,7 @@
<script src="editpane.js"/>
<vbox id="appcontent">
- <vbox id="editpane" hidden="true">
+ <vbox id="editpane" hidden="true" position="1">
<grid>
<columns>
<column/>
diff --git a/chrome/chromeFiles/content/scholar/sidebar.js b/chrome/chromeFiles/content/scholar/sidebar.js
@@ -18,6 +18,8 @@ Scholar.TreeView.prototype.setTree = function(treebox)
var newRows = Scholar.Items.getTreeRows();
for(var i = 0; i < newRows.length; i++)
this._showItem(newRows[i], 0, i+1); //item ref, isContainerOpen, level
+
+ this._refreshHashMap();
}
Scholar.TreeView.prototype.getCellText = function(row, column)
@@ -97,6 +99,7 @@ Scholar.TreeView.prototype.toggleOpenState = function(row)
this._treebox.rowCountChanged(row+1, count); //tell treebox to repaint these
this._treebox.invalidateRow(row);
this._treebox.endUpdateBatch();
+ this._refreshHashMap();
}
Scholar.TreeView.prototype.selectionChanged = function()
@@ -170,6 +173,27 @@ Scholar.TreeView.prototype.deleteSelection = function()
this._treebox.rowCountChanged(rows[i]-i, -1);
}
this._treebox.endUpdateBatch();
+
+ this._refreshHashMap();
+}
+
+Scholar.TreeView.prototype._refreshHashMap = function()
+{
+ // Create hash map of folder and object ids to row indexes
+ // Author: Dan Stillman
+
+ this._itemRowMap = new Array();
+ this._folderRowMap = new Array();
+ for(var i=0; i < this.rowCount; i++){
+ if (this.isContainer(i)){
+ this._folderRowMap[this._getItemAtRow(i).getID()] = i;
+ }
+ else {
+ this._itemRowMap[this._getItemAtRow(i).getID()] = i;
+ }
+ }
+ //Scholar.debug(Scholar.varDump(this.folderRowMap));
+ //Scholar.debug(Scholar.varDump(this.objectRowMap));
}
/*