From 44d2a98ef1e6dfb18823c39dbb7ee3179a841881 Mon Sep 17 00:00:00 2001 From: vincent Date: Sat, 26 Mar 2022 14:16:59 +0100 Subject: [PATCH] wip #5181 @0.25 --- resources/js/search.js | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/resources/js/search.js b/resources/js/search.js index c97a03b..6469bda 100644 --- a/resources/js/search.js +++ b/resources/js/search.js @@ -66,37 +66,6 @@ export default () => ({ 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()); - }, }); -- 2.39.5