Skip to content

Commit 527d9f6

Browse files
Image now displayed on Chrome, but has various spacing problems
1 parent 60803e3 commit 527d9f6

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/app/home/home.component.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,18 @@ function hello() {
3232
}`
3333
}
3434

35+
// TODO: Chose between iFrame and img
36+
// Create an iFrame and display it in a new window for our user to copy or save
3537
saveSnippet() {
3638
html2canvas(document.getElementsByClassName('console'), {
3739
onrendered: function(canvas) {
38-
var img = canvas.toDataURL()
39-
window.open(img);
40+
var url = canvas.toDataURL()
41+
// var iframe = '<iframe src="' + img + '" frameborder="0" style="border:0; top:0px; left:0px; bottom:0px; right:0px; width:100%; height:100%;" allowfullscreen></iframe>'
42+
var img = '<img src="' + url + '" style="border:0;"></img>'
43+
var x = window.open();
44+
x.document.open();
45+
x.document.write(img);
46+
x.document.close();
4047
}
4148
});
4249
}

0 commit comments

Comments
 (0)