Only display ad if content exists

This commit is contained in:
Eric Berry 2018-06-07 17:49:15 -06:00
parent 75439b5af3
commit 11a621fd50
2 changed files with 34 additions and 28 deletions

View File

@ -26,7 +26,7 @@ function loadCodeFund() {
function handler() { function handler() {
if (this.readyState === this.DONE) { if (this.readyState === this.DONE) {
_loaded = true; _loaded = true;
if (this.status === 200) { if (this.status === 200) {
resolve(this.response); resolve(this.response);
} else { } else {
@ -95,6 +95,10 @@ export default Ember.Component.extend({
displayTopicListTop: function() { displayTopicListTop: function() {
return this.get('placement') === 'topic-list-top'; return this.get('placement') === 'topic-list-top';
}.property('placement') }.property('placement'),
hasAd: function() {
return ((this.get('adDetails.description') || '').length > 0);
}.property('adDetails')
}); });

View File

@ -1,29 +1,31 @@
{{#if showAd}} {{#if showAd}}
{{#if site.mobileView}} {{#if hasAd}}
{{#if displayPostBottom}} {{#if site.mobileView}}
{{partial "components/codefund/post-bottom"}} {{#if displayPostBottom}}
{{/if}} {{partial "components/codefund/post-bottom"}}
{{#if displayTopicAbovePostStream}} {{/if}}
{{partial "components/codefund/topic-above-post-stream"}} {{#if displayTopicAbovePostStream}}
{{/if}} {{partial "components/codefund/topic-above-post-stream"}}
{{#if displayTopicAboveSuggested}} {{/if}}
{{partial "components/codefund/topic-above-suggested"}} {{#if displayTopicAboveSuggested}}
{{/if}} {{partial "components/codefund/topic-above-suggested"}}
{{#if displayTopicListTop}} {{/if}}
{{partial "components/codefund/topic-list-top"}} {{#if displayTopicListTop}}
{{/if}} {{partial "components/codefund/topic-list-top"}}
{{else}} {{/if}}
{{#if displayPostBottom}} {{else}}
{{partial "components/codefund/post-bottom"}} {{#if displayPostBottom}}
{{/if}} {{partial "components/codefund/post-bottom"}}
{{#if displayTopicAbovePostStream}} {{/if}}
{{partial "components/codefund/topic-above-post-stream"}} {{#if displayTopicAbovePostStream}}
{{/if}} {{partial "components/codefund/topic-above-post-stream"}}
{{#if displayTopicAboveSuggested}} {{/if}}
{{partial "components/codefund/topic-above-suggested"}} {{#if displayTopicAboveSuggested}}
{{/if}} {{partial "components/codefund/topic-above-suggested"}}
{{#if displayTopicListTop}} {{/if}}
{{partial "components/codefund/topic-list-top"}} {{#if displayTopicListTop}}
{{partial "components/codefund/topic-list-top"}}
{{/if}}
{{/if}} {{/if}}
{{/if}} {{/if}}
{{/if}} {{/if}}