htmlSafe and clean up

This commit is contained in:
Sarah Ni
2015-08-19 11:44:14 +10:00
parent 2237164075
commit fbb27c6060
3 changed files with 9 additions and 8 deletions
@@ -6,7 +6,6 @@ var const_height = '';
var _loaded = false,
_promise = null;
function splitWidthInt(value) {
var str = value.substring(0, 3);
return str.trim();
@@ -78,6 +77,10 @@ export default Ember.Component.extend({
return "div-gpt-ad-" + this.get('placement');
}.property('placement'),
adWrapperStyle: function() {
return `width: ${this.get('const_width')}px; height: ${this.get('const_height')}px;`.htmlSafe();
}.property('const_width', 'const_height'),
_initGoogleDFP: function() {
var self = this;
loadGoogle(this.siteSettings).then(function() {
@@ -1,10 +1,8 @@
<div class="google-dfp-ad-label"><h2>Google Ad Plugin Display</h2></div>
<div id={{divId}} style='width: {{const_width}}px; height: {{const_height}}px' class="dfp-ad-unit" align=center>
<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>