Fix stupid biblio bug

This commit is contained in:
Nicolò P 2024-11-25 18:52:07 +01:00
parent e3fe2f1b94
commit 023b94b2a0
2 changed files with 9 additions and 9 deletions

View File

@ -91,17 +91,17 @@ export class Finding {
let citations = '';
if (record.bibliography.length) {
record.bibliography.forEach(record => {
record.bibliography.forEach(biblio => {
citations += `
<span class="is-clickable is-capitalized has-text-link"
id="cit-${record.id}">
${record.citation.toLowerCase()},
</span> ${record.pages};
id="cit-${biblio.id}">
${biblio.citation.toLowerCase()},
</span> ${biblio.pages};
`;
this.biblioElements.push(`
<div class="p-2 mt-2" id="ref-${record.id}">
<p>${record.reference}</p>
<div class="p-2 mt-2" id="ref-${biblio.id}">
<p>${biblio.reference}</p>
</div>
`
);

View File

@ -182,7 +182,7 @@ UI.openNotConserModal = async function (data, selector) {
sheet.siteData = data;
modal.querySelector('#not-conser-sheet').innerHTML = await sheet.render();
modal.addEventListener('click', event => {
const biblio = document.querySelector('#biblio');
const biblio = modal.querySelector('#biblio');
if (event.target.id.includes('cit')) {
const id = event.target.id.replace('cit-','');
@ -226,9 +226,9 @@ UI.openFindingModal = async function (data, selector) {
finding.setImages();
modal.querySelector('#finding-sheet').innerHTML = await finding.render();
modal.addEventListener('click', event => {
const biblio = document.querySelector('#biblio');
if (event.target.id.includes('cit')) {
const biblio = modal.querySelector('#biblio');
if (event.target.id.includes('cit')) {
const id = event.target.id.replace('cit-','');
biblio.innerHTML = '<button class="delete"></button>';