From 8183a0aba7fe4a507661d30694e779c8f75505a5 Mon Sep 17 00:00:00 2001 From: mkendall07 Date: Wed, 8 Aug 2018 12:06:54 -0400 Subject: [PATCH 1/2] the dfp container div was not being resized, which results in content overlap --- src/secureCreatives.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/secureCreatives.js b/src/secureCreatives.js index 424d1402831..65ca55412c9 100644 --- a/src/secureCreatives.js +++ b/src/secureCreatives.js @@ -69,10 +69,14 @@ function sendAdToCreative(adObject, remoteDomain, source) { } function resizeRemoteCreative({ adUnitCode, width, height }) { - const iframe = document.getElementById( - find(window.googletag.pubads().getSlots().filter(isSlotMatchingAdUnitCode(adUnitCode)), slot => slot) - .getSlotElementId()).querySelector('iframe'); - - iframe.width = '' + width; - iframe.height = '' + height; + // resize both container div + iframe + ['div', 'iframe'].forEach(elmType => { + var element = getElementByAdUnit(elmType); + element.style.width = width; + element.style.height = height; + }); + function getElementByAdUnit(elmType) { + return document.getElementById(find(window.googletag.pubads().getSlots().filter(isSlotMatchingAdUnitCode(adUnitCode)), slot => slot) + .getSlotElementId()).querySelector(elmType); + } } From e45dd4214a4c2d1294571b098fb10d690770d070 Mon Sep 17 00:00:00 2001 From: mkendall07 Date: Wed, 8 Aug 2018 15:07:22 -0400 Subject: [PATCH 2/2] little cleanup --- src/secureCreatives.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/secureCreatives.js b/src/secureCreatives.js index 65ca55412c9..2204a6e7643 100644 --- a/src/secureCreatives.js +++ b/src/secureCreatives.js @@ -71,9 +71,9 @@ function sendAdToCreative(adObject, remoteDomain, source) { function resizeRemoteCreative({ adUnitCode, width, height }) { // resize both container div + iframe ['div', 'iframe'].forEach(elmType => { - var element = getElementByAdUnit(elmType); - element.style.width = width; - element.style.height = height; + let elementStyle = getElementByAdUnit(elmType).style; + elementStyle.width = width; + elementStyle.height = height; }); function getElementByAdUnit(elmType) { return document.getElementById(find(window.googletag.pubads().getSlots().filter(isSlotMatchingAdUnitCode(adUnitCode)), slot => slot)