Switch notes column back to counts, and hide by default
While the attachment icon helps with on-demand download, a count is probably more useful for notes, and between tag colors and the two dot columns things were getting a little Dance Dance Revolution.
This commit is contained in:
parent
d2f028d797
commit
98f62c6d3f
4 changed files with 23 additions and 24 deletions
|
@ -239,7 +239,7 @@
|
|||
zotero-persist="width ordinal hidden sortActive sortDirection"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol
|
||||
id="zotero-items-column-hasNote"
|
||||
id="zotero-items-column-numNotes" hidden="true"
|
||||
class="treecol-image"
|
||||
label="&zotero.tabs.notes.label;"
|
||||
src="chrome://zotero/skin/treeitem-note-small.png"
|
||||
|
|
|
@ -335,7 +335,7 @@ Zotero.ItemTreeView.prototype._refreshGenerator = function()
|
|||
var field = visibleFields[i];
|
||||
switch (field) {
|
||||
case 'hasAttachment':
|
||||
case 'hasNote':
|
||||
case 'numNotes':
|
||||
continue;
|
||||
|
||||
case 'year':
|
||||
|
@ -897,7 +897,7 @@ Zotero.ItemTreeView.prototype.getCellText = function(row, column)
|
|||
var val;
|
||||
|
||||
// Image only
|
||||
if (column.id === "zotero-items-column-hasAttachment" || column.id === "zotero-items-column-hasNote") {
|
||||
if (column.id === "zotero-items-column-hasAttachment") {
|
||||
return;
|
||||
}
|
||||
else if(column.id == "zotero-items-column-type")
|
||||
|
@ -908,6 +908,9 @@ Zotero.ItemTreeView.prototype.getCellText = function(row, column)
|
|||
else if (column.id == "zotero-items-column-year") {
|
||||
val = obj.getField('date', true).substr(0, 4)
|
||||
}
|
||||
else if (column.id === "zotero-items-column-numNotes") {
|
||||
val = obj.numNotes();
|
||||
}
|
||||
else {
|
||||
var col = column.id.substring(20);
|
||||
|
||||
|
@ -1061,19 +1064,6 @@ Zotero.ItemTreeView.prototype.getImageSrc = function(row, col)
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (col.id == 'zotero-items-column-hasNote') {
|
||||
if (this._itemGroup.isTrash()) return false;
|
||||
|
||||
var treerow = this._getItemAtRow(row);
|
||||
if (treerow.level === 0 && treerow.ref.isRegularItem() && treerow.ref.numNotes(false, true)) {
|
||||
return "chrome://zotero/skin/bullet_yellow.png";
|
||||
}
|
||||
else if (treerow.ref.isAttachment()) {
|
||||
if (treerow.ref.hasNote()) {
|
||||
return "chrome://zotero/skin/bullet_yellow.png";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Zotero.ItemTreeView.prototype.isContainer = function(row)
|
||||
|
@ -1330,12 +1320,11 @@ Zotero.ItemTreeView.prototype.sort = function(itemID)
|
|||
};
|
||||
break;
|
||||
|
||||
case 'hasNote':
|
||||
case 'numNotes':
|
||||
getField = function (row) {
|
||||
if (!row.ref.isRegularItem()) {
|
||||
return 0;
|
||||
}
|
||||
return row.ref.numNotes(false, true) ? 1 : 0;
|
||||
// Sort descending by default
|
||||
order = !order;
|
||||
return row.numNotes(false, true) || 0;
|
||||
};
|
||||
break;
|
||||
|
||||
|
@ -3007,3 +2996,10 @@ Zotero.ItemTreeView.TreeRow.prototype.getField = function(field, unformatted)
|
|||
{
|
||||
return this.ref.getField(field, unformatted, true);
|
||||
}
|
||||
|
||||
Zotero.ItemTreeView.TreeRow.prototype.numNotes = function() {
|
||||
if (!this.ref.isRegularItem()) {
|
||||
return '';
|
||||
}
|
||||
return this.ref.numNotes(false, true) || '';
|
||||
}
|
||||
|
|
|
@ -507,7 +507,7 @@
|
|||
zotero-persist="width ordinal hidden sortActive sortDirection"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol
|
||||
id="zotero-items-column-hasNote"
|
||||
id="zotero-items-column-numNotes" hidden="true"
|
||||
class="treecol-image"
|
||||
label="&zotero.tabs.notes.label;"
|
||||
src="chrome://zotero/skin/treeitem-note-small.png"
|
||||
|
|
|
@ -52,11 +52,14 @@
|
|||
background-image: none;
|
||||
}
|
||||
|
||||
#zotero-items-column-hasAttachment, #zotero-items-column-hasNote
|
||||
{
|
||||
#zotero-items-column-hasAttachment, #zotero-items-column-numNotes {
|
||||
min-width: 21px;
|
||||
}
|
||||
|
||||
#zotero-items-column-numNotes {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#zotero-items-tree treechildren::-moz-tree-image
|
||||
{
|
||||
margin-right: 5px;
|
||||
|
|
Loading…
Add table
Reference in a new issue