From 3ef8699900a717378e3c5a42b5798ffcc2006366 Mon Sep 17 00:00:00 2001 From: Sarah Ni Date: Thu, 20 Aug 2015 09:34:52 +1000 Subject: [PATCH] Mobile slots added within htmlSafe wrappers --- .../discourse/components/google-dfp-ad.js.es6 | 4 ++++ .../templates/components/google-dfp-ad.hbs | 17 +++++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/assets/javascripts/discourse/components/google-dfp-ad.js.es6 b/assets/javascripts/discourse/components/google-dfp-ad.js.es6 index adea1bb..bdbaeeb 100755 --- a/assets/javascripts/discourse/components/google-dfp-ad.js.es6 +++ b/assets/javascripts/discourse/components/google-dfp-ad.js.es6 @@ -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() { diff --git a/assets/javascripts/discourse/templates/components/google-dfp-ad.hbs b/assets/javascripts/discourse/templates/components/google-dfp-ad.hbs index 16cb096..c7e7993 100755 --- a/assets/javascripts/discourse/templates/components/google-dfp-ad.hbs +++ b/assets/javascripts/discourse/templates/components/google-dfp-ad.hbs @@ -1,8 +1,21 @@

Google Ad Plugin Display

+ +{{#if site.mobileView}} + +
+ {{#if loadedGoogletag}} + + +{{else}} +
{{#if loadedGoogletag}} - {{/if}} -
+ +{{/if}} + +
\ No newline at end of file