Closes #202, attachments categorized as notes
"Notes" column changed to "#" and combined with the attachment count. "#" isn't exactly immediately self-explanatory, but "Notes/attachments" would be way too long, and once you realize what it's for (i.e. the first time you create a child item), you really don't want the column taking up any more room than that... If people have a better suggestion, do share.
This commit is contained in:
parent
59c00ba6c2
commit
624faaf110
|
@ -214,9 +214,9 @@ Scholar.ItemTreeView.prototype.getCellText = function(row, column)
|
||||||
var obj = this._getItemAtRow(row);
|
var obj = this._getItemAtRow(row);
|
||||||
var val;
|
var val;
|
||||||
|
|
||||||
if(column.id == "numNotes")
|
if(column.id == "numChildren")
|
||||||
{
|
{
|
||||||
var c = obj.numNotes();
|
var c = obj.numChildren();
|
||||||
if(c) //don't display '0'
|
if(c) //don't display '0'
|
||||||
val = c;
|
val = c;
|
||||||
}
|
}
|
||||||
|
@ -280,7 +280,7 @@ Scholar.ItemTreeView.prototype.isContainerOpen = function(row)
|
||||||
|
|
||||||
Scholar.ItemTreeView.prototype.isContainerEmpty = 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)
|
Scholar.ItemTreeView.prototype.getLevel = function(row)
|
||||||
|
@ -407,11 +407,11 @@ Scholar.ItemTreeView.prototype.sort = function()
|
||||||
return (typeA > typeB) ? -1 : (typeA < typeB) ? 1 : 0;
|
return (typeA > typeB) ? -1 : (typeA < typeB) ? 1 : 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(column.id == 'numNotes')
|
else if(column.id == 'numChildren')
|
||||||
{
|
{
|
||||||
function columnSort(a,b)
|
function columnSort(a,b)
|
||||||
{
|
{
|
||||||
return b.numNotes() - a.numNotes();
|
return b.numChildren() - a.numChildren();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -775,18 +775,10 @@ Scholar.ItemTreeView.TreeRow.prototype.getType = function()
|
||||||
return this.ref.getType();
|
return this.ref.getType();
|
||||||
}
|
}
|
||||||
|
|
||||||
Scholar.ItemTreeView.TreeRow.prototype.numNotes = function()
|
Scholar.ItemTreeView.TreeRow.prototype.numChildren = function()
|
||||||
{
|
{
|
||||||
if(this.isRegularItem())
|
if(this.isRegularItem())
|
||||||
return this.ref.numNotes();
|
return this.ref.numChildren();
|
||||||
else
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
Scholar.ItemTreeView.TreeRow.prototype.numAttachments = function()
|
|
||||||
{
|
|
||||||
if(this.isRegularItem())
|
|
||||||
return this.ref.numAttachments();
|
|
||||||
else
|
else
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
|
@ -267,7 +267,7 @@ var ScholarPane = new function()
|
||||||
{
|
{
|
||||||
itemsView.selection.getRangeAt(i,start,end);
|
itemsView.selection.getRangeAt(i,start,end);
|
||||||
for (var j=start.value; j<=end.value && !hasChildren; j++)
|
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;
|
hasChildren = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -436,6 +436,8 @@ var ScholarPane = new function()
|
||||||
{
|
{
|
||||||
var row = {}, col = {}, obj = {};
|
var row = {}, col = {}, obj = {};
|
||||||
tree.treeBoxObject.getCellAt(event.clientX, event.clientY, 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)
|
if (obj.value && itemsView && itemsView.selection.currentIndex > -1)
|
||||||
{
|
{
|
||||||
var item = getSelectedItems()[0];
|
var item = getSelectedItems()[0];
|
||||||
|
|
|
@ -137,8 +137,8 @@
|
||||||
flex="1" persist="width ordinal hidden sortActive sortDirection"/>
|
flex="1" persist="width ordinal hidden sortActive sortDirection"/>
|
||||||
<splitter class="tree-splitter"/>
|
<splitter class="tree-splitter"/>
|
||||||
<treecol
|
<treecol
|
||||||
id="numNotes"
|
id="numChildren"
|
||||||
label="&items.numNotes_column;"
|
label="&items.numChildren_column;"
|
||||||
persist="width ordinal hidden sortActive sortDirection"/>
|
persist="width ordinal hidden sortActive sortDirection"/>
|
||||||
<splitter class="tree-splitter"/>
|
<splitter class="tree-splitter"/>
|
||||||
<treecol
|
<treecol
|
||||||
|
|
|
@ -792,6 +792,11 @@ Scholar.Item.prototype.isRegularItem = function(){
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Scholar.Item.prototype.numChildren = function(){
|
||||||
|
return this.numNotes() + this.numAttachments();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Methods dealing with note items
|
// Methods dealing with note items
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
<!ENTITY items.creator_column "Creator">
|
<!ENTITY items.creator_column "Creator">
|
||||||
<!ENTITY items.source_column "Source">
|
<!ENTITY items.source_column "Source">
|
||||||
<!ENTITY items.rights_column "Rights">
|
<!ENTITY items.rights_column "Rights">
|
||||||
<!ENTITY items.numNotes_column "Notes">
|
<!ENTITY items.numChildren_column "#">
|
||||||
<!ENTITY items.dateAdded_column "Date Added">
|
<!ENTITY items.dateAdded_column "Date Added">
|
||||||
<!ENTITY items.dateModified_column "Date Modified">
|
<!ENTITY items.dateModified_column "Date Modified">
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user