handle form as iframe

This commit is contained in:
Jonathan Labreuille
2016-03-22 17:23:33 +01:00
parent 3dae0ef13f
commit f91bfbf473
7 changed files with 148 additions and 9 deletions

23
assets/js/src/iframe.js Normal file
View File

@@ -0,0 +1,23 @@
define('iframe', ['mailpoet', 'jquery'], function(MailPoet, jQuery) {
'use strict';
MailPoet.Iframe = {
marginY: 15,
autoSize: function(iframe) {
if(!iframe) return;
this.setSize(
iframe,
iframe.contentWindow.document.body.scrollHeight
);
},
setSize: function(iframe, i) {
if(!iframe) return;
iframe.style.height = (
parseInt(i) + this.marginY
) + "px";
}
};
return MailPoet;
});