mirror of
https://github.com/zotero/zotero.git
synced 2026-10-03 02:21:49 +00:00
Citation Explorer: Fix highlighting inconsistencies
This commit is contained in:
parent
41e0c15f04
commit
a0735fdb2c
1 changed files with 6 additions and 11 deletions
|
|
@ -250,9 +250,10 @@ window.ZoteroDocumentCitations = {
|
|||
},
|
||||
|
||||
_initMappings: async function () {
|
||||
const itemMap = {};
|
||||
itemRows = items.map((item) => {
|
||||
let citedIn = [];
|
||||
return new Proxy(item, {
|
||||
let proxyItem = new Proxy(item, {
|
||||
get(target, prop) {
|
||||
if (prop == 'id' && !target.id) {
|
||||
return target.cslItemID;
|
||||
|
|
@ -263,6 +264,8 @@ window.ZoteroDocumentCitations = {
|
|||
return Reflect.get(...arguments);
|
||||
}
|
||||
});
|
||||
itemMap[item.id || item.cslItemID] = proxyItem;
|
||||
return proxyItem;
|
||||
});
|
||||
uncitedItemRows = uncitedItems.map((item) => {
|
||||
return new Proxy(item, {
|
||||
|
|
@ -280,16 +283,8 @@ window.ZoteroDocumentCitations = {
|
|||
let citedItems = [];
|
||||
// check if all citation items are linked
|
||||
for (let citationItem of citation.citationItems) {
|
||||
itemRows.forEach((itemRow, itemIndex) => {
|
||||
if ([itemRow.id, itemRow.cslItemID].includes(citationItem.id)) {
|
||||
citedItems.push(itemIndex);
|
||||
itemRow.citedIn.push(citationIndex);
|
||||
}
|
||||
});
|
||||
if (typeof citationItem.id != 'number') {
|
||||
isLinked = false;
|
||||
break;
|
||||
}
|
||||
itemMap[citationItem.id].citedIn.push(citationIndex);
|
||||
isLinked = typeof citationItem.id == 'number';
|
||||
}
|
||||
let title = await citation.field.getText();
|
||||
if (citation.properties.plainCitation != title) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue