Files
piratepoet/assets/js/src/iframe.js
Amine Ben hammou 95551ad049 ES5 keyword-spacing
2017-09-21 09:13:36 +00:00

27 lines
513 B
JavaScript

define('iframe', ['mailpoet'], function (mp) {
'use strict';
var MailPoet = mp;
MailPoet.Iframe = {
marginY: 20,
autoSize: function (iframe) {
if (!iframe) return;
this.setSize(
iframe,
iframe.contentWindow.document.body.scrollHeight
);
},
setSize: function (sizeIframe, i) {
var iframe = sizeIframe;
if (!iframe) return;
iframe.style.height = (
parseInt(i, 10) + this.marginY
) + 'px';
}
};
return MailPoet;
});