fix screenshots
This commit is contained in:
@@ -92,8 +92,10 @@ define(
|
|||||||
},
|
},
|
||||||
saveTemplate: function (response, done) {
|
saveTemplate: function (response, done) {
|
||||||
const iframe = document.createElement('iframe');
|
const iframe = document.createElement('iframe');
|
||||||
|
iframe.width = 660;
|
||||||
iframe.src = response.meta.preview_url;
|
iframe.src = response.meta.preview_url;
|
||||||
iframe.onload = () => {
|
iframe.onload = () => {
|
||||||
|
setTimeout(() => {
|
||||||
html2canvas(iframe.contentDocument.documentElement).then((thumbnail) => {
|
html2canvas(iframe.contentDocument.documentElement).then((thumbnail) => {
|
||||||
document.body.removeChild(iframe);
|
document.body.removeChild(iframe);
|
||||||
MailPoet.Ajax.post({
|
MailPoet.Ajax.post({
|
||||||
@@ -110,6 +112,7 @@ define(
|
|||||||
},
|
},
|
||||||
}).then(done).fail(this.showError);
|
}).then(done).fail(this.showError);
|
||||||
});
|
});
|
||||||
|
}, 500);
|
||||||
};
|
};
|
||||||
// just to hide the iframe
|
// just to hide the iframe
|
||||||
iframe.style.cssText ='position: absolute; opacity:0; z-index: -9999';
|
iframe.style.cssText ='position: absolute; opacity:0; z-index: -9999';
|
||||||
|
Reference in New Issue
Block a user