Skip to content
This repository has been archived by the owner on Apr 1, 2020. It is now read-only.

Ads - specifying ad loading viewport margins for different screensizes/page types #1094

Merged
merged 7 commits into from Sep 27, 2017

Conversation

andrewgeorgiou1981
Copy link
Contributor

Copy link
Contributor

@adgad adgad left a comment

Choose a reason for hiding this comment

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

couple of minor points

return '0%';
function setViewportMarginBy () {
let pt = appName;
pt = pt.toLowerCase().substr(0, 3);
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it necessary to substring it here? Might be more readable later on to refer to 'front-page' (or whatever the full name is)

if (pt === 'fro') {
if (scrnSize < 760) {return '15%';}
else {
if (pt === 'fro' && scrnSize < 980) {return '5%';}
Copy link
Contributor

Choose a reason for hiding this comment

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

checking 'fro' again here shouldn't be necessary

sandbox.restore();
});
it('Should pass 15% when screen size is narrower than 760px and adOptimizeLazyLoad flag is defined and appName is fro', () => {
sandbox.stub(utils, 'getScreenSize', () => { return 750; });
Copy link
Contributor

Choose a reason for hiding this comment

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

We should probably remove the flag from the tests...it's a little confusing otherwise

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i was planning to keep the flag but update it so that its no longer an MVT - this would allow us to toggle the viewport margin. However, i guess it doesnt give us much benefit so, as you say it might be less confusing to remove it.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 92.225% when pulling 9cea797 on ads-view-margins into bede42d on master.

@andrewgeorgiou1981 andrewgeorgiou1981 merged commit 4bf1442 into master Sep 27, 2017
@leafrogers leafrogers deleted the ads-view-margins branch December 9, 2017 01:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants