diff --git a/chrome/chromeFiles/content/scholar/itemTreeView.js b/chrome/chromeFiles/content/scholar/itemTreeView.js index eadf1d402..b236f86b7 100644 --- a/chrome/chromeFiles/content/scholar/itemTreeView.js +++ b/chrome/chromeFiles/content/scholar/itemTreeView.js @@ -214,9 +214,9 @@ Scholar.ItemTreeView.prototype.getCellText = function(row, column) var obj = this._getItemAtRow(row); var val; - if(column.id == "numNotes") + if(column.id == "numChildren") { - var c = obj.numNotes(); + var c = obj.numChildren(); if(c) //don't display '0' val = c; } @@ -280,7 +280,7 @@ Scholar.ItemTreeView.prototype.isContainerOpen = function(row) Scholar.ItemTreeView.prototype.isContainerEmpty = function(row) { - return (this._getItemAtRow(row).numNotes() == 0 && this._getItemAtRow(row).numAttachments() == 0); + return this._getItemAtRow(row).numChildren() == 0; } Scholar.ItemTreeView.prototype.getLevel = function(row) @@ -407,11 +407,11 @@ Scholar.ItemTreeView.prototype.sort = function() return (typeA > typeB) ? -1 : (typeA < typeB) ? 1 : 0; } } - else if(column.id == 'numNotes') + else if(column.id == 'numChildren') { function columnSort(a,b) { - return b.numNotes() - a.numNotes(); + return b.numChildren() - a.numChildren(); } } else @@ -775,18 +775,10 @@ Scholar.ItemTreeView.TreeRow.prototype.getType = function() return this.ref.getType(); } -Scholar.ItemTreeView.TreeRow.prototype.numNotes = function() +Scholar.ItemTreeView.TreeRow.prototype.numChildren = function() { if(this.isRegularItem()) - return this.ref.numNotes(); - else - return 0; -} - -Scholar.ItemTreeView.TreeRow.prototype.numAttachments = function() -{ - if(this.isRegularItem()) - return this.ref.numAttachments(); + return this.ref.numChildren(); else return 0; } \ No newline at end of file diff --git a/chrome/chromeFiles/content/scholar/overlay.js b/chrome/chromeFiles/content/scholar/overlay.js index c7544d6bd..bc447456c 100644 --- a/chrome/chromeFiles/content/scholar/overlay.js +++ b/chrome/chromeFiles/content/scholar/overlay.js @@ -267,7 +267,7 @@ var ScholarPane = new function() { itemsView.selection.getRangeAt(i,start,end); for (var j=start.value; j<=end.value && !hasChildren; j++) - if(itemsView._getItemAtRow(j).numNotes() || itemsView._getItemAtRow(j).numAttachments()) + if(itemsView._getItemAtRow(j).numChildren()) hasChildren = true; } } @@ -436,6 +436,8 @@ var ScholarPane = new function() { var row = {}, col = {}, obj = {}; tree.treeBoxObject.getCellAt(event.clientX, event.clientY, row, col, obj); + // obj.value == cell/text/image + // TODO: handle collection double-click if (obj.value && itemsView && itemsView.selection.currentIndex > -1) { var item = getSelectedItems()[0]; diff --git a/chrome/chromeFiles/content/scholar/overlay.xul b/chrome/chromeFiles/content/scholar/overlay.xul index 250965438..113ac2063 100644 --- a/chrome/chromeFiles/content/scholar/overlay.xul +++ b/chrome/chromeFiles/content/scholar/overlay.xul @@ -137,8 +137,8 @@ flex="1" persist="width ordinal hidden sortActive sortDirection"/> - +