Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add logic to resize AST divs and iframes #3206

Merged
merged 5 commits into from
Nov 8, 2018

Conversation

jsnellbaker
Copy link
Collaborator

@jsnellbaker jsnellbaker commented Oct 19, 2018

NOTE check with @mkendall07 first before merging.

Type of change

  • Feature

Description of change

This change adds/fixes some of the logic used in the resizeRemoteCreative function. The function will now:

  • not only rely on GAM tags being present on the page; it will now support AST tags or a div that matches the value in the bid's adUnitCode*
  • throw a warning message when it's unable to find the page element to resize instead of either silently failing or throwing an undefined exception.
  • this back-up can be removed if desired. I added it as a catch-all fallback instead of throwing an warning/error.


function getAstElementId(adUnitCode) {
let apn = window.apntag;
let astTagIds = apn.requests && apn.requests.tags && Object.keys(apn.requests.tags);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's see if there is a way to do this without accessing apn.request object.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I replaced the apntag.requests reference with the new API function.

Copy link
Member

@mkendall07 mkendall07 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to change the access to apntag.requests

@jsnellbaker jsnellbaker merged commit 2206ba4 into master Nov 8, 2018
pedrolopezmrf pushed a commit to Marfeel/Prebid.js that referenced this pull request Mar 18, 2019
* add logic to resize AST divs and iframes

* fix import package

* replace AST lookup with new API function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants