diff --git a/chrome/content/zotero/tabs.js b/chrome/content/zotero/tabs.js index 12580d310c..668b621312 100644 --- a/chrome/content/zotero/tabs.js +++ b/chrome/content/zotero/tabs.js @@ -105,7 +105,7 @@ var Zotero_Tabs = new function () { else if (tab.data?.itemID) { try { let item = Zotero.Items.get(tab.data.itemID); - icon = ; + icon = ; } catch (e) { // item might not yet be loaded, we will get the icon on the next update @@ -885,7 +885,7 @@ var Zotero_Tabs = new function () { else { span.classList.add("icon-item-type"); let item = Zotero.Items.get(tab.data.itemID); - let dataTypeLabel = item.getItemTypeIconName(); + let dataTypeLabel = item.getItemTypeIconName(true); span.setAttribute("data-item-type", dataTypeLabel); } diff --git a/chrome/content/zotero/xpcom/data/item.js b/chrome/content/zotero/xpcom/data/item.js index 90d4992d42..05bcc9ff65 100644 --- a/chrome/content/zotero/xpcom/data/item.js +++ b/chrome/content/zotero/xpcom/data/item.js @@ -4407,13 +4407,12 @@ Zotero.Item.prototype.getImageSrc = function() { } -Zotero.Item.prototype.getItemTypeIconName = function () { +Zotero.Item.prototype.getItemTypeIconName = function (skipLinkMode = false) { var itemType = Zotero.ItemTypes.getName(this.itemTypeID); if (itemType == 'attachment') { var linkMode = this.attachmentLinkMode; - if (this.isPDFAttachment()) { - if (linkMode == Zotero.Attachments.LINK_MODE_LINKED_FILE) { + if (!skipLinkMode && linkMode == Zotero.Attachments.LINK_MODE_LINKED_FILE) { itemType += 'PDFLink'; } else { @@ -4421,7 +4420,7 @@ Zotero.Item.prototype.getItemTypeIconName = function () { } } else if (this.isEPUBAttachment()) { - if (linkMode == Zotero.Attachments.LINK_MODE_LINKED_FILE) { + if (!skipLinkMode && linkMode == Zotero.Attachments.LINK_MODE_LINKED_FILE) { itemType += 'EPUBLink'; } else { @@ -4429,15 +4428,15 @@ Zotero.Item.prototype.getItemTypeIconName = function () { } } else if (this.isImageAttachment()) { - itemType += linkMode == Zotero.Attachments.LINK_MODE_LINKED_FILE ? 'ImageLink' : 'Image'; + itemType += linkMode == (!skipLinkMode && Zotero.Attachments.LINK_MODE_LINKED_FILE) ? 'ImageLink' : 'Image'; } else if (this.isVideoAttachment()) { - itemType += linkMode == Zotero.Attachments.LINK_MODE_LINKED_FILE ? 'VideoLink' : 'Video'; + itemType += linkMode == (!skipLinkMode && Zotero.Attachments.LINK_MODE_LINKED_FILE) ? 'VideoLink' : 'Video'; } else if (linkMode == Zotero.Attachments.LINK_MODE_IMPORTED_FILE) { itemType += "File"; } - else if (linkMode == Zotero.Attachments.LINK_MODE_LINKED_FILE) { + else if (!skipLinkMode && linkMode == Zotero.Attachments.LINK_MODE_LINKED_FILE) { itemType += "Link"; } else if (linkMode == Zotero.Attachments.LINK_MODE_IMPORTED_URL) {