return `${this.results.length} résultats`;
},
- viewerURL: '/front/coeur/pdfjs/web/viewer.html?file=', // Base URL for viewer
-
- openPDF(PDF_URL, updateQuerystring = true) {
- PDF_URL = PDF_URL.replace('./storage', '../../../storage');
-
- // Extra level needed when on non-exported version
- if (location.href.includes('/front/') && !PDF_URL.includes('http')) {
- PDF_URL = '../' + PDF_URL;
- }
-
- if (updateQuerystring) {
- const location = new URL(window.location.href);
- location.searchParams.set('pdf', PDF_URL);
- history.replaceState(null, document.title, location.toString());
- }
-
- this.PDFOpen = true;
- this.$nextTick(() => {
- this.$refs.PDFViewer.setAttribute('src', this.viewerURL + PDF_URL)
- });
- },
-
- closePDF() {
- this.PDFOpen = false;
- this.$refs.PDFViewer.setAttribute('src', '');
-
- // Update the page URL to remove querystring
- const location = new URL(window.location.href);
- location.searchParams.delete('pdf');
- history.replaceState(null, document.title, location.toString());
- },
});