Skip to content

Commit

Permalink
Support html2canvas v1.0.0 with promise-based call
Browse files Browse the repository at this point in the history
  • Loading branch information
eKoopmans committed Dec 19, 2017
1 parent 32447ef commit 0dfaa13
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,13 @@ var html2pdf = function(source, opt) {

// Render the canvas and pass the result to makePDF.
var onRendered = opt.html2canvas.onrendered || function() {};
opt.html2canvas.onrendered = function(canvas) {
delete opt.html2canvas.onrendered;
var done = function(canvas) {
onRendered(canvas);
document.body.removeChild(overlay);
html2pdf.makePDF(canvas, pageSize, opt);
}
html2canvas(container, opt.html2canvas);
};
html2canvas(container, opt.html2canvas).then(done);
};

html2pdf.parseInput = function(source, opt) {
Expand Down

0 comments on commit 0dfaa13

Please sign in to comment.