A platform for community discussion. Free, open, simple.
FIX: colspan issue with house-ad component (#38001)
Bannon Tanner1d1d8336ff7b
diff --git a/plugins/discourse-adplugin/assets/javascripts/discourse/components/ad-component.js b/plugins/discourse-adplugin/assets/javascripts/discourse/components/ad-component.jsindex 0d8da5a717e..3fee38f1b03 100644--- a/plugins/discourse-adplugin/assets/javascripts/discourse/components/ad-component.js+++ b/plugins/discourse-adplugin/assets/javascripts/discourse/components/ad-component.js@@ -106,6 +106,10 @@ export default class AdComponent extends Component {didInsertElement() {super.didInsertElement?.(...arguments);+ if (this.colspan && this.element) {+ this.element.setAttribute("colspan", this.colspan);+ }+if (!this.get("showAd")) {return;}diff --git a/plugins/discourse-adplugin/assets/javascripts/discourse/components/ad-slot.gjs b/plugins/discourse-adplugin/assets/javascripts/discourse/components/ad-slot.gjsindex 03a71a68c28..89795ad822f 100644--- a/plugins/discourse-adplugin/assets/javascripts/discourse/components/ad-slot.gjs+++ b/plugins/discourse-adplugin/assets/javascripts/discourse/components/ad-slot.gjs@@ -268,6 +268,7 @@ export default class AdSlot extends AdComponent {@postNumber={{this.postNumber}}@indexNumber={{this.indexNumber}}@tagName={{this.childTagName}}+ @colspan={{this.colspan}}/>{{/each}}{{/each}}diff --git a/plugins/discourse-adplugin/assets/javascripts/discourse/components/house-ad.gjs b/plugins/discourse-adplugin/assets/javascripts/discourse/components/house-ad.gjsindex 0427fd3a7eb..6dc9718d872 100644--- a/plugins/discourse-adplugin/assets/javascripts/discourse/components/house-ad.gjs+++ b/plugins/discourse-adplugin/assets/javascripts/discourse/components/house-ad.gjs@@ -193,11 +193,7 @@ export default class HouseAd extends AdComponent {}<template>- <div- colspan={{this.colspanAttribute}}- class={{concatClass "house-creative" this.adUnitClass}}- ...attributes- >+ <div class={{concatClass "house-creative" this.adUnitClass}} ...attributes>{{#if this.showAd}}{{htmlSafe this.adHtml}}{{/if}}diff --git a/plugins/discourse-adplugin/assets/javascripts/discourse/connectors/after-topic-list-item/discourse-adplugin.gjs b/plugins/discourse-adplugin/assets/javascripts/discourse/connectors/after-topic-list-item/discourse-adplugin.gjsindex 8cd64d1f85e..e85221ae6c5 100644--- a/plugins/discourse-adplugin/assets/javascripts/discourse/connectors/after-topic-list-item/discourse-adplugin.gjs+++ b/plugins/discourse-adplugin/assets/javascripts/discourse/connectors/after-topic-list-item/discourse-adplugin.gjs@@ -25,6 +25,7 @@ export default class DiscourseAdplugin extends Component {@category={{this.category.slug}}@indexNumber={{this.index}}@childTagName="td"+ @colspan="5"/></tr></template>