File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -32,11 +32,18 @@ function hello() {
32
32
}`
33
33
}
34
34
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
35
37
saveSnippet ( ) {
36
38
html2canvas ( document . getElementsByClassName ( 'console' ) , {
37
39
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 ( ) ;
40
47
}
41
48
} ) ;
42
49
}
You can’t perform that action at this time.
0 commit comments