Fix for phantomjs w/signature
This commit is contained in:
parent
cdaf6e5a70
commit
b2c1aae537
1 changed files with 25 additions and 8 deletions
|
|
@ -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…
Add table
Reference in a new issue