From 205c67a968f6047206223f27a42f60120f1b9ed5 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Sun, 14 Feb 2016 20:14:24 +0200 Subject: [PATCH] Temporariy change to work around Chrome 48 bug --- resources/views/invoices/pdf.blade.php | 4 +++- resources/views/invoices/view.blade.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/resources/views/invoices/pdf.blade.php b/resources/views/invoices/pdf.blade.php index f185c9df066f..21b2e5d92043 100644 --- a/resources/views/invoices/pdf.blade.php +++ b/resources/views/invoices/pdf.blade.php @@ -98,7 +98,9 @@ function refreshPDFCB(string) { if (!string) return; PDFJS.workerSrc = '{{ asset('js/pdf_viewer.worker.js') }}'; - if ({{ Auth::check() && Auth::user()->force_pdfjs ? 'false' : 'true' }} && (isFirefox || (isChrome && !isChrome48))) { + 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' }})))) { $('#theFrame').attr('src', string).show(); } else { if (isRefreshing) { diff --git a/resources/views/invoices/view.blade.php b/resources/views/invoices/view.blade.php index 326865935b64..c1ba3822899a 100644 --- a/resources/views/invoices/view.blade.php +++ b/resources/views/invoices/view.blade.php @@ -85,7 +85,7 @@ - @include('invoices.pdf', ['account' => $invoice->client->account]) + @include('invoices.pdf', ['account' => $invoice->client->account, 'viewPDF' => true])