moving width to css
This commit is contained in:
@@ -29,3 +29,5 @@
|
|||||||
@require 'mp2migrator'
|
@require 'mp2migrator'
|
||||||
|
|
||||||
@require '../../../node_modules/react-confirm-alert/src/react-confirm-alert.css'
|
@require '../../../node_modules/react-confirm-alert/src/react-confirm-alert.css'
|
||||||
|
|
||||||
|
@require 'newsletter_templates'
|
7
assets/css/src/newsletter_templates.styl
Normal file
7
assets/css/src/newsletter_templates.styl
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
@require 'newsletter_editor/variables'
|
||||||
|
|
||||||
|
.mailpoet_template_iframe
|
||||||
|
position: absolute
|
||||||
|
z-index: -9999
|
||||||
|
width: $newsletter-width
|
||||||
|
max-width: $newsletter-width
|
@@ -92,30 +92,27 @@ 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({
|
api_version: window.mailpoet_api_version,
|
||||||
api_version: window.mailpoet_api_version,
|
endpoint: 'newsletterTemplates',
|
||||||
endpoint: 'newsletterTemplates',
|
action: 'save',
|
||||||
action: 'save',
|
data: {
|
||||||
data: {
|
newsletter_id: response.data.id,
|
||||||
newsletter_id: response.data.id,
|
name: response.data.subject,
|
||||||
name: response.data.subject,
|
description: response.data.preheader,
|
||||||
description: response.data.preheader,
|
thumbnail: thumbnail.toDataURL('image/jpeg'),
|
||||||
thumbnail: thumbnail.toDataURL('image/jpeg'),
|
body: JSON.stringify(response.data.body),
|
||||||
body: JSON.stringify(response.data.body),
|
categories: '["recent"]',
|
||||||
categories: '["recent"]',
|
},
|
||||||
},
|
}).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.className ='mailpoet_template_iframe';
|
||||||
document.body.appendChild(iframe);
|
document.body.appendChild(iframe);
|
||||||
},
|
},
|
||||||
handleSend: function (e) {
|
handleSend: function (e) {
|
||||||
|
1027
package-lock.json
generated
1027
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user