Edit pane is now at the top of the window.
Hash map is created to keep track of rows by item ID.
This commit is contained in:
parent
74e2d5a842
commit
22d6e93478
2 changed files with 25 additions and 1 deletions
|
@ -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/>
|
||||
|
|
|
@ -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()
|
||||
|
@ -171,6 +174,27 @@ Scholar.TreeView.prototype.deleteSelection = function()
|
|||
}
|
||||
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));
|
||||
|
||||
}
|
||||
/*
|
||||
DRAG AND DROP (IMPLEMENT LATER)
|
||||
|
|
Loading…
Add table
Reference in a new issue