2019-12-18 15:11:45 +00:00
|
|
|
var emailFrame = document.getElementById("email-frame");
|
|
|
|
if (emailFrame) {
|
2020-01-08 11:38:09 +00:00
|
|
|
// Resize the frame with its content
|
2019-12-18 15:11:45 +00:00
|
|
|
var resizeFrame = function() {
|
|
|
|
emailFrame.style.height = emailFrame.contentWindow.document.documentElement.scrollHeight + "px";
|
|
|
|
};
|
|
|
|
emailFrame.addEventListener("load", resizeFrame);
|
|
|
|
emailFrame.contentWindow.addEventListener("resize", resizeFrame);
|
2020-01-08 11:38:09 +00:00
|
|
|
|
|
|
|
// Polyfill in case the srcdoc attribute isn't supported
|
|
|
|
if (!emailFrame.srcdoc) {
|
|
|
|
var srcdoc = emailFrame.getAttribute("srcdoc");
|
|
|
|
var doc = emailFrame.contentWindow.document;
|
|
|
|
doc.open();
|
|
|
|
doc.write(srcdoc);
|
|
|
|
doc.close();
|
|
|
|
}
|
2019-12-18 15:11:45 +00:00
|
|
|
}
|