From fa6ccc601503b2f1ba583da4e4b8241118543696 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Tue, 20 Dec 2016 14:43:43 +0200 Subject: [PATCH] Simply forceJS code --- resources/views/invoices/pdf.blade.php | 7 ++++--- resources/views/invoices/view.blade.php | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/resources/views/invoices/pdf.blade.php b/resources/views/invoices/pdf.blade.php index 440703c16b..e28f7d5e1f 100644 --- a/resources/views/invoices/pdf.blade.php +++ b/resources/views/invoices/pdf.blade.php @@ -117,10 +117,11 @@ function refreshPDFCB(string) { if (!string) return; PDFJS.workerSrc = '{{ asset('js/pdf_viewer.worker.js') }}'; - var forceJS = {{ Auth::check() && Auth::user()->force_pdfjs ? 'false' : 'true' }}; - // Temporarily workaround for: https://code.google.com/p/chromium/issues/detail?id=574648 - if (forceJS && (isFirefox || (isChrome && (!isChrome48 || {{ isset($viewPDF) && $viewPDF ? 'true' : 'false' }})))) { + var forceJS = {{ Auth::check() && Auth::user()->force_pdfjs ? 'true' : 'false' }}; + // Use the browser's built in PDF viewer + if ((isChrome || isFirefox) && ! forceJS) { $('#theFrame').attr('src', string).show(); + // Use PDFJS to view the PDF } else { if (isRefreshing) { needsRefresh = true; diff --git a/resources/views/invoices/view.blade.php b/resources/views/invoices/view.blade.php index 9ced648f25..2834c9e276 100644 --- a/resources/views/invoices/view.blade.php +++ b/resources/views/invoices/view.blade.php @@ -285,7 +285,7 @@ - @include('invoices.pdf', ['account' => $invoice->client->account, 'viewPDF' => true]) + @include('invoices.pdf', ['account' => $invoice->client->account])