Skip to content

Commit

Permalink
Fix issue where observeIntersection was not returning the unlisten fu… (
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelRegus authored and erwinmombay committed May 3, 2016
1 parent 90b930f commit 407fd96
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion 3p/integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,12 @@ window.draw3p = function(opt_configCallback, opt_allowed3pTypes,
// This only actually works for ads.
const initialIntersection = window.context.initialIntersection;
window.context.observeIntersection = cb => {
observeIntersection(cb);
const unlisten = observeIntersection(cb);
// Call the callback with the value that was transmitted when the
// iframe was drawn. Called in nextTick, so that callers don't
// have to specially handle the sync case.
nextTick(window, () => cb([initialIntersection]));
return unlisten;
};
window.context.onResizeSuccess = onResizeSuccess;
window.context.onResizeDenied = onResizeDenied;
Expand Down

0 comments on commit 407fd96

Please sign in to comment.