import { Controller } from "@hotwired/stimulus" export default class extends Controller { static targets = ['biblio', 'cit', 'ref', 'close']; open(event) { const biblio = window.Biblio; const target = event.currentTarget; const id = target.id.replace('cit-', ''); this.biblioTarget.innerHTML = ''; this.biblioTarget.innerHTML += biblio.getReference(id); this.showBiblio(); } close() { this.modalTarget.classList.remove('is-active'); } showBiblio() { this.biblioTarget.classList.remove('is-hidden'); this.biblioTarget.scrollIntoView({behavior: 'smooth'}); } hideBiblio() { this.biblioTarget.classList.add('is-hidden'); } }