mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Use PDF.js on mobile browsers
This commit is contained in:
parent
c09b645191
commit
5c8d4cf324
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -8,11 +8,7 @@ var isChromium = isChrome && navigator.userAgent.indexOf('Chromium') >= 0;
|
||||
// https://code.google.com/p/chromium/issues/detail?id=574648
|
||||
var isChrome48 = isChrome && navigator.userAgent.indexOf('Chrome/48') >= 0;
|
||||
var isIE = /*@cc_on!@*/false || !!document.documentMode; // At least IE6
|
||||
|
||||
function isMobile() {
|
||||
try{ document.createEvent("TouchEvent"); return true; }
|
||||
catch(e){ return false; }
|
||||
}
|
||||
var isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
|
||||
|
||||
var refreshTimer;
|
||||
function generatePDF(invoice, javascript, force, cb) {
|
||||
|
@ -125,7 +125,7 @@
|
||||
PDFJS.workerSrc = '{{ asset('js/pdf_viewer.worker.js') }}';
|
||||
var forceJS = {{ Auth::check() && Auth::user()->force_pdfjs ? 'true' : 'false' }};
|
||||
// Use the browser's built in PDF viewer
|
||||
if ((isChrome || isFirefox) && ! forceJS && ! isMobile()) {
|
||||
if ((isChrome || isFirefox) && ! forceJS && ! isMobile) {
|
||||
$('#theFrame').attr('src', string).show();
|
||||
// Use PDFJS to view the PDF
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user