Skip to content

Commit

Permalink
Small logic tweak for ads
Browse files Browse the repository at this point in the history
  • Loading branch information
tjvantoll committed Jul 28, 2015
1 parent 3a636ef commit 01e2948
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions _includes/dynamic/ads.html
Expand Up @@ -15,8 +15,8 @@
script.async = true;
script.onload = function() {
if (isSmallScreen) {
var paragraphs = document.querySelectorAll(".entry-content p");
paragraphToUse = paragraphs.length > 2 ? paragraphs[2] : paragraphs[0];
var paragraphs = document.querySelectorAll(".entry-content > p");
paragraphToUse = paragraphs.length > 1 ? paragraphs[1] : paragraphs[0];
paragraphToUse.parentNode.insertBefore(ad, paragraphToUse);
}
ad.style.display = "block";
Expand Down

0 comments on commit 01e2948

Please sign in to comment.