1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-20 00:11:35 +02:00

Simply forceJS code

This commit is contained in:
Hillel Coren 2016-12-20 14:43:43 +02:00
parent 68d3322032
commit fa6ccc6015
2 changed files with 5 additions and 4 deletions

View File

@ -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;

View File

@ -285,7 +285,7 @@
</script>
@include('invoices.pdf', ['account' => $invoice->client->account, 'viewPDF' => true])
@include('invoices.pdf', ['account' => $invoice->client->account])
<p>&nbsp;</p>