mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fix PDF on older IE
This commit is contained in:
parent
512c6ebd43
commit
4705c6179c
@ -118,26 +118,12 @@
|
|||||||
return getPDFString(refreshPDFCB, force);
|
return getPDFString(refreshPDFCB, force);
|
||||||
} catch (exception) {
|
} catch (exception) {
|
||||||
if (location.href.indexOf('/view/')) {
|
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) {
|
$.get(url, function(result) {
|
||||||
refreshPDFCB(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) {
|
function refreshPDFCB(string) {
|
||||||
|
@ -237,9 +237,15 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
function onDownloadClick() {
|
function onDownloadClick() {
|
||||||
var doc = generatePDF(invoice, invoice.invoice_design.javascript, true);
|
try {
|
||||||
var fileName = invoice.is_quote ? invoiceLabels.quote : invoiceLabels.invoice;
|
var doc = generatePDF(invoice, invoice.invoice_design.javascript, true);
|
||||||
doc.save(fileName + '-' + invoice.invoice_number + '.pdf');
|
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() {
|
function showCustomModal() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user