Skip to content

Commit

Permalink
Fix importStyle
Browse files Browse the repository at this point in the history
outerHTML seems to do the trick.
  • Loading branch information
oculus42 committed Mar 15, 2018
1 parent bd2eb39 commit 884e3ee
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions printThis.js
Original file line number Diff line number Diff line change
Expand Up @@ -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("<title>" + opt.pageTitle + "</title>");
Expand Down

0 comments on commit 884e3ee

Please sign in to comment.