mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-08-07 10:01:47 -04:00
Simply forceJS code
This commit is contained in:
parent
68d3322032
commit
fa6ccc6015
@ -117,10 +117,11 @@
|
|||||||
function refreshPDFCB(string) {
|
function refreshPDFCB(string) {
|
||||||
if (!string) return;
|
if (!string) return;
|
||||||
PDFJS.workerSrc = '{{ asset('js/pdf_viewer.worker.js') }}';
|
PDFJS.workerSrc = '{{ asset('js/pdf_viewer.worker.js') }}';
|
||||||
var forceJS = {{ Auth::check() && Auth::user()->force_pdfjs ? 'false' : 'true' }};
|
var forceJS = {{ Auth::check() && Auth::user()->force_pdfjs ? 'true' : 'false' }};
|
||||||
// Temporarily workaround for: https://code.google.com/p/chromium/issues/detail?id=574648
|
// Use the browser's built in PDF viewer
|
||||||
if (forceJS && (isFirefox || (isChrome && (!isChrome48 || {{ isset($viewPDF) && $viewPDF ? 'true' : 'false' }})))) {
|
if ((isChrome || isFirefox) && ! forceJS) {
|
||||||
$('#theFrame').attr('src', string).show();
|
$('#theFrame').attr('src', string).show();
|
||||||
|
// Use PDFJS to view the PDF
|
||||||
} else {
|
} else {
|
||||||
if (isRefreshing) {
|
if (isRefreshing) {
|
||||||
needsRefresh = true;
|
needsRefresh = true;
|
||||||
|
@ -285,7 +285,7 @@
|
|||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@include('invoices.pdf', ['account' => $invoice->client->account, 'viewPDF' => true])
|
@include('invoices.pdf', ['account' => $invoice->client->account])
|
||||||
|
|
||||||
<p> </p>
|
<p> </p>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user