update test

pull/1393/head
Rich Harris 7 years ago
parent 7e8329379c
commit 5f46650801

@ -26,8 +26,11 @@ function addResizeListener(element, fn) {
object.setAttribute('style', 'display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; pointer-events: none; z-index: -1;'); object.setAttribute('style', 'display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; pointer-events: none; z-index: -1;');
object.type = 'text/html'; object.type = 'text/html';
let win;
object.onload = () => { object.onload = () => {
object.contentDocument.defaultView.addEventListener('resize', fn); win = object.contentDocument.defaultView;
win.addEventListener('resize', fn);
}; };
if (/Trident/.test(navigator.userAgent)) { if (/Trident/.test(navigator.userAgent)) {
@ -40,7 +43,7 @@ function addResizeListener(element, fn) {
return { return {
cancel: () => { cancel: () => {
object.contentDocument.defaultView.removeEventListener('resize', fn); win.removeEventListener('resize', fn);
element.removeChild(object); element.removeChild(object);
} }
}; };

Loading…
Cancel
Save