Wait until load to bind the resize handler.

This commit is contained in:
nobuti 2017-01-12 05:59:31 +01:00
parent d74bdcccec
commit 9fc34100df

View File

@ -16,7 +16,9 @@ module.exports = function (element) {
var frame = document.createElement('iframe'); var frame = document.createElement('iframe');
frame.style.cssText = CSS; frame.style.cssText = CSS;
element.appendChild(frame); element.appendChild(frame);
frame.onload = function () {
i.event.bind(frame.contentWindow, 'resize', handler); i.event.bind(frame.contentWindow, 'resize', handler);
};
return frame; return frame;
}; };