Fix sorting of top-level attachments in attachments column
Also hide the attachments column by default in the select-items dialog
This commit is contained in:
parent
98f62c6d3f
commit
b0a71467ea
2 changed files with 8 additions and 3 deletions
|
@ -232,7 +232,7 @@
|
|||
flex="1" zotero-persist="width ordinal hidden sortActive sortDirection"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol
|
||||
id="zotero-items-column-hasAttachment"
|
||||
id="zotero-items-column-hasAttachment" hidden="true"
|
||||
class="treecol-image"
|
||||
label="&zotero.tabs.attachments.label;"
|
||||
src="chrome://zotero/skin/attach-small.png"
|
||||
|
|
|
@ -1308,10 +1308,15 @@ Zotero.ItemTreeView.prototype.sort = function(itemID)
|
|||
|
||||
case 'hasAttachment':
|
||||
getField = function (row) {
|
||||
if (!row.ref.isRegularItem()) {
|
||||
if (row.ref.isAttachment()) {
|
||||
var state = row.ref.fileExists ? 1 : -1;
|
||||
}
|
||||
else if (row.ref.isRegularItem()) {
|
||||
var state = row.ref.getBestAttachmentState();
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
}
|
||||
var state = row.ref.getBestAttachmentState();
|
||||
// Make sort order present, missing, empty when ascending
|
||||
if (state === -1) {
|
||||
state = 2;
|
||||
|
|
Loading…
Add table
Reference in a new issue