mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-08-05 11:10:16 -04:00
Fix for phantomjs w/signature
This commit is contained in:
parent
cdaf6e5a70
commit
b2c1aae537
@ -231,6 +231,25 @@
|
||||
window['pjsc_meta'].remainingTasks++;
|
||||
}
|
||||
|
||||
function waitForSignature() {
|
||||
if (window.signatureAsPNG) {
|
||||
writePdfAsString();
|
||||
} else {
|
||||
window.setTimeout(waitForSignature, 100);
|
||||
}
|
||||
}
|
||||
|
||||
function writePdfAsString() {
|
||||
doc = getPDFString();
|
||||
doc.getDataUrl(function(pdfString) {
|
||||
document.write(pdfString);
|
||||
document.close();
|
||||
if (window.hasOwnProperty('pjsc_meta')) {
|
||||
window['pjsc_meta'].remainingTasks--;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(function() {
|
||||
@if (Input::has('phantomjs'))
|
||||
@if (Input::has('phantomjs_balances'))
|
||||
@ -240,14 +259,12 @@
|
||||
window['pjsc_meta'].remainingTasks--;
|
||||
}
|
||||
@else
|
||||
doc = getPDFString();
|
||||
doc.getDataUrl(function(pdfString) {
|
||||
document.write(pdfString);
|
||||
document.close();
|
||||
if (window.hasOwnProperty('pjsc_meta')) {
|
||||
window['pjsc_meta'].remainingTasks--;
|
||||
}
|
||||
});
|
||||
@if ($account->signature_on_pdf)
|
||||
refreshPDF();
|
||||
waitForSignature();
|
||||
@else
|
||||
writePdfAsString();
|
||||
@endif
|
||||
@endif
|
||||
@else
|
||||
refreshPDF();
|
||||
|
Loading…
x
Reference in New Issue
Block a user