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"/>
|
flex="1" zotero-persist="width ordinal hidden sortActive sortDirection"/>
|
||||||
<splitter class="tree-splitter"/>
|
<splitter class="tree-splitter"/>
|
||||||
<treecol
|
<treecol
|
||||||
id="zotero-items-column-hasAttachment"
|
id="zotero-items-column-hasAttachment" hidden="true"
|
||||||
class="treecol-image"
|
class="treecol-image"
|
||||||
label="&zotero.tabs.attachments.label;"
|
label="&zotero.tabs.attachments.label;"
|
||||||
src="chrome://zotero/skin/attach-small.png"
|
src="chrome://zotero/skin/attach-small.png"
|
||||||
|
|
|
@ -1308,10 +1308,15 @@ Zotero.ItemTreeView.prototype.sort = function(itemID)
|
||||||
|
|
||||||
case 'hasAttachment':
|
case 'hasAttachment':
|
||||||
getField = function (row) {
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
var state = row.ref.getBestAttachmentState();
|
|
||||||
// Make sort order present, missing, empty when ascending
|
// Make sort order present, missing, empty when ascending
|
||||||
if (state === -1) {
|
if (state === -1) {
|
||||||
state = 2;
|
state = 2;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue