1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-13 22:54:25 +01:00

Fix PDF on older IE

This commit is contained in:
Hillel Coren 2017-05-24 11:28:11 +03:00
parent 512c6ebd43
commit 4705c6179c
2 changed files with 10 additions and 18 deletions

View File

@ -118,26 +118,12 @@
return getPDFString(refreshPDFCB, force);
} catch (exception) {
if (location.href.indexOf('/view/')) {
var url = location.href.replace('/view/', '/download/') + '?base64=true&silent=true';
var url = location.href.replace('/view/', '/download/') + '?base64=true';
$.get(url, function(result) {
refreshPDFCB(result);
})
}
}
/*
@if (true || isset($usePhantomJS) && $usePhantomJS)
console.log(location.href);
console.log(location.href.indexOf('/view/'));
console.log();
return false;
$.get('http://ninja.dev/download/...?base64=true', function(result) {
refreshPDFCB(result);
})
return false;
@else
return getPDFString(refreshPDFCB, force);
@endif
*/
}
function refreshPDFCB(string) {

View File

@ -237,9 +237,15 @@
});
function onDownloadClick() {
var doc = generatePDF(invoice, invoice.invoice_design.javascript, true);
var fileName = invoice.is_quote ? invoiceLabels.quote : invoiceLabels.invoice;
doc.save(fileName + '-' + invoice.invoice_number + '.pdf');
try {
var doc = generatePDF(invoice, invoice.invoice_design.javascript, true);
var fileName = invoice.is_quote ? invoiceLabels.quote : invoiceLabels.invoice;
doc.save(fileName + '-' + invoice.invoice_number + '.pdf');
} catch (exception) {
if (location.href.indexOf('/view/')) {
location.href = location.href.replace('/view/', '/download/');
}
}
}
function showCustomModal() {