]> _ Git - odl.git/commitdiff
wip #5181 @0.25
authorvincent <vincent@enhydra.fr>
Sat, 26 Mar 2022 13:16:59 +0000 (14:16 +0100)
committervincent <vincent@enhydra.fr>
Sat, 26 Mar 2022 13:16:59 +0000 (14:16 +0100)
resources/js/search.js

index c97a03b954c4410f385f07b886ffbfc7bc44cd51..6469bda3fdd7010242b2cecc9575360c51ddad8c 100644 (file)
@@ -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());
-    },
 
 });