closes #209, Scholar does not refresh the item pane when a new collection is clicked

it's possible that this fix will introduce some bugs, but it appears to work fine
This commit is contained in:
Simon Kornblith 2006-08-25 19:15:03 +00:00
parent 624faaf110
commit 62ffea9542
7 changed files with 35 additions and 14 deletions

View file

@ -29,8 +29,6 @@
<script src="include.js"/>
<script src="overlay.js"/>
<script src="itemTreeView.js"/>
<script src="collectionTreeView.js"/>
<script src="fileInterface.js"/>
<commandset id="mainCommandSet">

View file

@ -37,8 +37,6 @@
style="padding:2em">
<script src="include.js"/>
<script src="collectionTreeView.js"/>
<script src="itemTreeView.js"/>
<script src="selectItemsDialog.js"/>
<hbox flex="1">

View file

@ -52,7 +52,6 @@ Scholar.Ingester.ProxyMonitor = new function() {
return;
}
Scholar.debug(channel.URI.spec);
// We should be able to scrape the URL out of this
var m = _ezProxyRe.exec(channel.URI.spec);
if(!m) {

View file

@ -214,9 +214,9 @@ Scholar.ItemTreeView.prototype.getCellText = function(row, column)
var obj = this._getItemAtRow(row);
var val;
if(column.id == "numChildren")
if(column.id == "numNotes")
{
var c = obj.numChildren();
var c = obj.numNotes();
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).numChildren() == 0;
return (this._getItemAtRow(row).numNotes() == 0 && this._getItemAtRow(row).numAttachments() == 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 == 'numChildren')
else if(column.id == 'numNotes')
{
function columnSort(a,b)
{
return b.numChildren() - a.numChildren();
return b.numNotes() - a.numNotes();
}
}
else
@ -775,10 +775,18 @@ Scholar.ItemTreeView.TreeRow.prototype.getType = function()
return this.ref.getType();
}
Scholar.ItemTreeView.TreeRow.prototype.numChildren = function()
Scholar.ItemTreeView.TreeRow.prototype.numNotes = function()
{
if(this.isRegularItem())
return this.ref.numChildren();
return this.ref.numNotes();
else
return 0;
}
Scholar.ItemTreeView.TreeRow.prototype.numAttachments = function()
{
if(this.isRegularItem())
return this.ref.numAttachments();
else
return 0;
}

View file

@ -295,8 +295,10 @@ var Scholar = new function(){
for (var i=0; i<args.length; i++){
if (typeof args[i]=='object'){
for (var j=0; j<args[i].length; j++){
returns.push(args[i][j]);
if(args[i]) {
for (var j=0; j<args[i].length; j++){
returns.push(args[i][j]);
}
}
}
else {

View file

@ -66,6 +66,22 @@ Cc["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Ci.mozIJSSubScriptLoader)
.loadSubScript("chrome://scholar/content/xpcom/mime.js");
Cc["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Ci.mozIJSSubScriptLoader)
.loadSubScript("chrome://scholar/content/xpcom/itemTreeView.js");
Cc["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Ci.mozIJSSubScriptLoader)
.loadSubScript("chrome://scholar/content/xpcom/collectionTreeView.js");
Cc["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Ci.mozIJSSubScriptLoader)
.loadSubScript("chrome://global/content/nsTransferable.js");
Cc["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Ci.mozIJSSubScriptLoader)
.loadSubScript("chrome://global/content/nsDragAndDrop.js");
/********************************************************************/