alps/plugins/viewhtml/public/assets/script.js

19 lines
604 B
JavaScript
Raw Normal View History

2019-12-18 15:11:45 +00:00
var emailFrame = document.getElementById("email-frame");
if (emailFrame) {
// 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);
// 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
}