From 64f6cf21527160af11aa74e7f9ea250af7afb137 Mon Sep 17 00:00:00 2001 From: Samuel Rouse Date: Tue, 19 Dec 2017 22:30:03 -0500 Subject: [PATCH] Add Top-Level Canvas Support Fixes #136 --- printThis.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/printThis.js b/printThis.js index ad8b349..d176dbc 100644 --- a/printThis.js +++ b/printThis.js @@ -201,7 +201,8 @@ if (opt.canvas) { // add canvas data-ids for easy access after cloning. var canvasId = 0; - $element.find('canvas').each(function(){ + // .addBack('canvas') adds the top-level element if it is a canvas. + $element.find('canvas').addBack('canvas').each(function(){ $(this).attr('data-printthis', canvasId++); }); }