1
0
mirror of synced 2026-08-05 18:06:54 +00:00

Mobile slots added within htmlSafe wrappers

This commit is contained in:
Sarah Ni
2015-08-20 09:34:52 +10:00
parent fbb27c6060
commit 3ef8699900
2 changed files with 19 additions and 2 deletions
@@ -81,6 +81,10 @@ export default Ember.Component.extend({
return `width: ${this.get('const_width')}px; height: ${this.get('const_height')}px;`.htmlSafe();
}.property('const_width', 'const_height'),
adWrapperStyleMobile: function() {
return `width: 320px; height: 50px;`.htmlSafe();
},
_initGoogleDFP: function() {
var self = this;
loadGoogle(this.siteSettings).then(function() {
@@ -1,8 +1,21 @@
<div class="google-dfp-ad-label"><h2>Google Ad Plugin Display</h2></div>
{{#if site.mobileView}}
<div id={{divId}} style={{adWrapperStyleMobile}} class="dfp-ad-unit" align=center>
{{#if loadedGoogletag}}
<script type='text/javascript'>
googletag.cmd.push(function() { googletag.display('{{divId}}'); });
</script>
{{else}}
<div id={{divId}} style={{adWrapperStyle}} class="dfp-ad-unit" align=center>
{{#if loadedGoogletag}}
<script type='text/javascript'>
googletag.cmd.push(function() { googletag.display('{{divId}}'); });
</script>
{{/if}}
</div>
{{/if}}
</div>