From bd2eb3908680920711200c902893371fe26e217e Mon Sep 17 00:00:00 2001 From: Samuel Rouse Date: Thu, 15 Mar 2018 06:59:56 -0400 Subject: [PATCH 1/3] Test new styleImport Fix --- printThis.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/printThis.js b/printThis.js index b3778a5..6f957c6 100644 --- a/printThis.js +++ b/printThis.js @@ -165,9 +165,13 @@ }); // import style tags - if (opt.importStyle) $("style").each(function() { - $(this).clone().appendTo($head); - }); + if (opt.importStyle) { + var styles = document.getElementsByTagName("STYLE"); + $head.append(styles); + } + // if (opt.importStyle) $("style").each(function() { + // $(this).clone().appendTo($head); + // }); // add title of the page if (opt.pageTitle) $head.append("" + opt.pageTitle + ""); From 884e3ee84d97d67c7a398eaddc2edf8c114f4dce Mon Sep 17 00:00:00 2001 From: Samuel Rouse Date: Thu, 15 Mar 2018 07:42:22 -0400 Subject: [PATCH 2/3] Fix importStyle outerHTML seems to do the trick. --- printThis.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/printThis.js b/printThis.js index 6f957c6..569ce4b 100644 --- a/printThis.js +++ b/printThis.js @@ -165,13 +165,9 @@ }); // import style tags - if (opt.importStyle) { - var styles = document.getElementsByTagName("STYLE"); - $head.append(styles); - } - // if (opt.importStyle) $("style").each(function() { - // $(this).clone().appendTo($head); - // }); + if (opt.importStyle) $("style").each(function() { + $head.append(this.outerHTML); + }); // add title of the page if (opt.pageTitle) $head.append("" + opt.pageTitle + ""); From cbbe6946cb72be0879896d47fde2e45e56eb9442 Mon Sep 17 00:00:00 2001 From: Samuel Rouse Date: Sun, 18 Mar 2018 12:58:36 -0400 Subject: [PATCH 3/3] Add patch version bump for this fix. --- changelog.txt | 3 +++ package.json | 2 +- printThis.jquery.json | 2 +- printThis.js | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/changelog.txt b/changelog.txt index 0e0c596..c162092 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,6 @@ +03/18/2018 Fixed importStyle + Bumped to 1.12.3 + 01/10/2018 Merged fix for top-level Canvas support Bumped to 1.12.2 diff --git a/package.json b/package.json index ad1c318..34d12d3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "print-this", - "version": "1.12.2", + "version": "1.12.3", "description": "Printing plug-in for jQuery", "main": "printThis.js", "dependencies": { diff --git a/printThis.jquery.json b/printThis.jquery.json index 8d40da8..0c97903 100644 --- a/printThis.jquery.json +++ b/printThis.jquery.json @@ -1,6 +1,6 @@ { "name": "printThis", - "version": "1.12.2", + "version": "1.12.3", "title": "printThis", "description": "Printing plug-in for jQuery. Print specific page elements, add print options, maintain or add new styling using jQuery.", "author": { diff --git a/printThis.js b/printThis.js index 569ce4b..b7dc8fd 100644 --- a/printThis.js +++ b/printThis.js @@ -1,5 +1,5 @@ /* - * printThis v1.12.2 + * printThis v1.12.3 * @desc Printing plug-in for jQuery * @author Jason Day *